Skip to content

fix(app): use reconcile for session_status in bootstrap to clear stale entries#17658

Closed
ualtinok wants to merge 1 commit intoanomalyco:devfrom
ualtinok:fix/stale-session-status-reconcile
Closed

fix(app): use reconcile for session_status in bootstrap to clear stale entries#17658
ualtinok wants to merge 1 commit intoanomalyco:devfrom
ualtinok:fix/stale-session-status-reconcile

Conversation

@ualtinok
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #17657

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When bootstrapDirectory fetches fresh session statuses from the server via session.status(), it uses setStore("session_status", x.data!) to update the SolidJS store. SolidJS's setStore with a plain object merges keys — it iterates for (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 how permission and question are already handled in the same file (lines 167-201).

How did you verify your code works?

  • LSP diagnostics clean on the changed file
  • bun typecheck passes for the app package (tsgo -b)
  • bun test session-cache — 3 tests pass
  • bun test event-reducer — 13 tests pass

Screenshots / recordings

N/A — no UI change, behavioral fix only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@nexxeln
Copy link
Copy Markdown
Member

nexxeln commented Mar 16, 2026

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.

@ualtinok ualtinok closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: Session spinners persist indefinitely due to SolidJS store merge behavior in bootstrap

2 participants