Skip to content

fix(web): keep global SSE alive for session list status updates#694

Open
heavygee wants to merge 1 commit into
tiann:mainfrom
heavygee:fix/session-list-status
Open

fix(web): keep global SSE alive for session list status updates#694
heavygee wants to merge 1 commit into
tiann:mainfrom
heavygee:fix/session-list-status

Conversation

@heavygee
Copy link
Copy Markdown
Contributor

Summary

Fix stale session-list spinners when the user has another session open in the web UI.

The app previously replaced its sole SSE subscription with a session-scoped stream whenever a session was selected. Cross-session session-updated patches (including thinking: false) never reached the sidebar, so background sessions could finish work but keep spinning until refresh.

This change keeps an always-on { all: true } SSE connection for session-list and lifecycle events, and adds a second session-scoped SSE stream for message delivery when a session is open. Both streams report visibility for push fallback. Hub sendMessage() now records session activity so web-originated sends refresh list timestamps.

Related closed work: #470 (dual SSE fix was not merged).

Test plan

  • bun run typecheck
  • cd hub && bun test
  • cd web && bun test src/lib/appSseSubscriptions.test.ts src/hooks/useSSE.test.ts src/components/SessionList.test.ts
  • Manual: open session A, run work in session B, confirm B sidebar spinner clears when B finishes without selecting B

Issues

Fixes #693

When a session is open, the web app now keeps an always-on all:true SSE
connection for sidebar session-updated events while using a second
session-scoped stream for message delivery. Also bump session activity on
hub sendMessage so web-originated sends refresh list timestamps.

Fixes tiann#693

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • No issues found.

Summary

  • Review mode: initial
  • Reviewed the full diff at the current head. No correctness, security, regression, data-loss, performance, or maintainability issues met the reporting threshold.
  • Residual risk: no integration coverage observed for the new dual SSE topology across global/session connections, visibility reporting, and toast delivery.

Testing

  • Not run (automation): bun is not installed in this runner, so bun run test:web -- useSSE appSseSubscriptions and bun run typecheck:web could not execute.

HAPI Bot

heavygee added a commit to heavygee/hapi that referenced this pull request May 25, 2026
…#694

The following files were accidentally included from work intended for a
separate PR (session-list-status / SSE split subscriptions) due to that
branch being submitted from main rather than its own worktree branch:

- web/src/App.tsx (reverted to upstream/main)
- web/src/hooks/useSSE.ts (reverted to upstream/main)
- web/src/hooks/useSSE.test.ts (removed — added by other branch)
- web/src/lib/appSseSubscriptions.ts (removed — added by other branch)
- web/src/lib/appSseSubscriptions.test.ts (removed — added by other branch)
- hub/src/sync/syncEngine.ts (reverted to upstream/main)

Apologies for the noise. This PR (tiann#692) is scoped to the pluggable voice
backend only.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(web): session list spinner stays active when viewing another session

1 participant