fix(web): stop showing unread dots for cancelled or failed sessions - #977
Conversation
🦋 Changeset detectedLatest commit: 2798fe6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2798fe6646
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } else { | ||
| // A background session just finished a turn the user hasn't seen — light up | ||
| // its unread dot until they open it. | ||
| } else if (status === 'idle') { |
There was a problem hiding this comment.
Clear persisted unread flags for aborted sessions
When a user already has rawState.unreadBySession[sid] === true for a session that is now cancelled/failed (for example the stale localStorage entries called out in this PR’s refresh scenario), this new status === 'idle' guard only avoids setting another flag; it never removes the existing one. Since unreadBySession is exposed from the stored map without checking the session status, aborted sessions can still render with an unread dot after refresh or after receiving an aborted status. The aborted branch should clear and persist the flag for that session.
Useful? React with 👍 / 👎.
Related Issue
N/A — reported directly by a user.
Problem
The web sidebar lights up an unread blue dot for any background session whose turn ends, including sessions that were cancelled or failed. Those flags are persisted to
localStorage, so after a page refresh the sidebar fills with stale unread dots even though there is no new reply to read.What changed
Only mark a session as unread when its turn finishes normally (
idle). Cancelled / failed turns (aborted) still run their in-flight and queue cleanup, but no longer set the unread flag.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.