Skip to content

fix(sync): add SSE heartbeat and alive status - #223

Merged
tiann merged 1 commit into
tiann:mainfrom
Lihengwannafly:pr/sync-sse-heartbeat
Feb 27, 2026
Merged

fix(sync): add SSE heartbeat and alive status#223
tiann merged 1 commit into
tiann:mainfrom
Lihengwannafly:pr/sync-sse-heartbeat

Conversation

@Lihengwannafly

@Lihengwannafly Lihengwannafly commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

What / Why

Prevent silent SSE stalls and reduce “stale UI” issues by adding server heartbeats and smarter client reconnection + incremental cache updates.

Changes

  • Hub /api/events: send periodic SSE heartbeats and include subscriptionId in connection-changed.
  • Web useSSE: heartbeat watchdog + reconnect backoff; batch invalidations; incremental patching for sessions/machines when possible.
  • Sync: include active status in alive updates; tighten machine/session cache refresh behavior.

Tests

  • cd hub && bun test
  • cd web && bun run test
  • cd hub && bun run typecheck
  • cd web && bun run typecheck

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Findings

  • None.

Summary

  • No issues found in diff. Residual risk: new SSE reconnect/heartbeat + cache patching paths in web/src/hooks/useSSE.ts not covered by web tests (repo has no web tests).

Testing

  • Not run (automation)

@tiann
tiann merged commit 1942f08 into tiann:main Feb 27, 2026
2 checks passed
jasonczc pushed a commit to jasonczc/haqi that referenced this pull request Mar 15, 2026
SeeFlowerX pushed a commit to SeeFlowerX/hapi that referenced this pull request Apr 1, 2026
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.

2 participants