Conversation
…init Stale cached userId in localStorage triggers eager threadListAdapter.initialize() on /login before useAuth clears the session. The resulting 401 from POST /api/chat-service/threads surfaces as an unhandled rejection captured by Sentry, even though onUnauthorized() in chatConfig already fires the redirect. Extends the existing "Thread not found" suppression in GrueneratorChatProvider to also drop "Unauthorized" rejections — same root cause class (assistant-ui optimisticUpdate paths we can't intercept via onClick).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stale cached
userIdin localStorage triggers eagerthreadListAdapter.initialize()on/loginbeforeuseAuthclears the session. The resulting 401 fromPOST /api/chat-service/threadssurfaces as an unhandled rejection captured by Sentry — even thoughonUnauthorized()inchatConfigalready handles the redirect side effect.This extends the existing
"Thread not found"suppression inGrueneratorChatProviderto also drop"Unauthorized"rejections — same root-cause class (assistant-uioptimisticUpdatepaths we can't intercept viaonClick).Root cause
authStorerehydrates synchronously fromlocalStorage(15-min TTL cache)./login, cacheduserIdis non-empty even though the backend session is invalid.if (!userId) return childrenguard atGrueneratorChatProvider.tsx:421passes; runtime mounts.optimisticUpdate.initializeeagerly callsthreadListAdapter.initialize(), whichPOSTs/api/chat-service/threads.request()inChatContext.tsx:33callsonUnauthorized()thenthrow new Error('Unauthorized').history.load's try/catch — Sentry captures it.The redirect side effect already happens before the throw, so suppressing the unhandled rejection is purely about Sentry noise.
GlitchTip issue: GRUENERATOR-46 (494 events).
Test plan
"Thread not found"suppression still works (delete a thread)/loginno longer hits Sentry butonUnauthorizedredirect still fires when the user is on a protected page