Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8898245. Configure here.
| getKeyFromLocalStore, | ||
| setKeyToLocalStore, | ||
| shouldPersistSession, | ||
| STORAGE_KEYS, |
There was a problem hiding this comment.
Test mock missing sessionId key breaks getSessionId path
Low Severity
The STORAGE_KEYS mock in queue-service.test.ts only includes userQueueNextPullCheck, but queue-service.ts's getSessionId() also accesses STORAGE_KEYS.sessionId. Before this PR, sessionIdLocalStoreName was a constant defined directly in queue-service.ts and always available. Now it comes from the mocked module and resolves to undefined, causing getKeyFromLocalStore(undefined) and setKeyToLocalStore(undefined, ...) calls during tests that invoke getUserQueue().
Reviewed by Cursor Bugbot for commit 8898245. Configure here.


Consolidating storage key definitions into central location and typing helper functions to maintain consistency.
Note
Medium Risk
Broad refactor across queue/user/message managers to use centralized
STORAGE_KEYS; a wrong key mapping would break persisted state (tokens, queue polling, SSE flags), though key strings themselves remain unchanged.Overview
Consolidates browser storage key usage by introducing a shared
STORAGE_KEYSmap inlocal-storage.tsand updating managers/services to reference it instead of duplicating string constants.local-storagehelpers are now typed to acceptStorageKey | string, and expiry cleanup uses a smallisGistKeyhelper. Tests were updated to mockSTORAGE_KEYSaccordingly, andqueue-serviceno longer exports storage-key constants (callers now useSTORAGE_KEYSdirectly).Reviewed by Cursor Bugbot for commit 2401653. Bugbot is set up for automated code reviews on this repo. Configure here.