Skip to content

Fix/queued encrypted writes#286

Open
jwaspin wants to merge 2 commits intorelease/2.6.0from
fix/queued-encrypted-writes
Open

Fix/queued encrypted writes#286
jwaspin wants to merge 2 commits intorelease/2.6.0from
fix/queued-encrypted-writes

Conversation

@jwaspin
Copy link
Copy Markdown
Contributor

@jwaspin jwaspin commented Feb 23, 2026

Summary

This pull request introduces improvements to the encrypted persistence middleware, focusing on preventing data loss and ensuring correct handling of queued writes during user session changes. The main changes include session-scoped write queues, best-effort flushes on logout, and enhanced test coverage for these behaviors.

Session management and data integrity:

  • Added session-scoped write queues in encryptedMiddleware.js to prevent replaying stale writes across user logins and logouts, and implemented logic to drop queued writes if the authentication context changes. [1] [2]
  • Introduced flushWriteQueueForCurrentSession and clearWriteQueue functions to support best-effort flushing and queue clearing during logout or session changes, and updated setCurrentUserForMiddleware and clearCurrentUserFromMiddleware to handle session transitions. [1] [2]
  • Updated the logout function in AuthContext.jsx to flush queued writes before clearing authentication state, reducing potential data loss. [1] [2]

Testing improvements:

  • Added new tests in encryptedMiddleware.test.js to verify that queued writes are not replayed after logout and subsequent login, and that writes are flushed for the active session before logout.

Dependency and version update:

  • Bumped the app version to 2.5.0-rc.0 in package.json to reflect these middleware and session management enhancements.

Changes

Testing

  • pnpm lint
  • pnpm test

Checklist

  • Version updated appropriately in package.json
  • CHANGELOG updated
  • Tests updated/added if needed
  • No console warnings/errors introduced

Related Issues

  • Closes #

Manual QA

  • Navigate between Dashboard (/dashboard) and Accounts (/accounts)
  • Create an account via "Create New Account"
  • Verify Material-UI components render correctly
  • Confirm version display appears (vX.Y.Z) and update dialog dismisses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant