You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The restore effect in app/hooks/useAssistantChat.ts:97-101 catches every failure the same way:
.catch(()=>{if(cancelled)return;if(!initialSessionId)localStorage.removeItem(SESSION_KEY);setError("Failed to restore the previous conversation.");})
Two problems, and they are inverses of each other:
404 is benign. The session expired (2h TTL) or was flushed (Assistant: startup cache flush wipes all live sessions #1523). Nothing is broken -- the right behavior is to clear the stale localStorage pointer and silently start a fresh conversation. Instead the user gets an error banner on a page they just loaded.
5xx / timeout is the real failure, and it is the one case where we should NOT clear localStorage. The session may still be alive server-side; dropping the pointer turns a transient blip into permanent loss of the conversation for that user.
So the fix is to branch on status: 404 -> remove the key, no error banner. Anything else -> keep the key, show a retryable error.
This came up in the beta-readiness review as the "session-restore data loss" item. The startup flush in #1523 makes it fire considerably more often than that review assumed.
The restore effect in
app/hooks/useAssistantChat.ts:97-101catches every failure the same way:Two problems, and they are inverses of each other:
So the fix is to branch on status: 404 -> remove the key, no error banner. Anything else -> keep the key, show a retryable error.
This came up in the beta-readiness review as the "session-restore data loss" item. The startup flush in #1523 makes it fire considerably more often than that review assumed.