fix(app): use reconcile for session_status in bootstrap to clear stale entries#17658
Closed
ualtinok wants to merge 1 commit intoanomalyco:devfrom
Closed
fix(app): use reconcile for session_status in bootstrap to clear stale entries#17658ualtinok wants to merge 1 commit intoanomalyco:devfrom
ualtinok wants to merge 1 commit intoanomalyco:devfrom
Conversation
Member
|
folded your bootstrap fix into #17593 so it can ship with the broader backend + tui fix too. i cherry-picked your commit with authorship preserved so you still get credit here. thanks for catching the bootstrap path. |
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.
Issue for this PR
Closes #17657
Type of change
What does this PR do?
When
bootstrapDirectoryfetches fresh session statuses from the server viasession.status(), it usessetStore("session_status", x.data!)to update the SolidJS store. SolidJS'ssetStorewith a plain object merges keys — it iteratesfor (const key in value)and sets each property, but never removes keys absent from the new value.When the server returns
{}(all sessions idle), this is a complete no-op — zero keys to iterate, so stale{ type: "busy" }entries from previous SSE events survive indefinitely. This causes session spinners to persist in the sidebar even after sessions are idle.The fix wraps the value in
reconcile()(already imported in bootstrap.ts), which properly replaces the entire record including deleting stale keys. This matches howpermissionandquestionare already handled in the same file (lines 167-201).How did you verify your code works?
bun typecheckpasses for theapppackage (tsgo -b)bun test session-cache— 3 tests passbun test event-reducer— 13 tests passScreenshots / recordings
N/A — no UI change, behavioral fix only.
Checklist