Skip to content

fix(app): reconnect stale event streams - #41002

Open
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:event-stream-watchdog
Open

fix(app): reconnect stale event streams#41002
zcxGGmu wants to merge 1 commit into
anomalyco:devfrom
zcxGGmu:event-stream-watchdog

Conversation

@zcxGGmu

@zcxGGmu zcxGGmu commented Aug 7, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #40910

Type of change

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

What does this PR do?

Adds a client-side watchdog for the global web event stream. After a stream connects, the watchdog is reset whenever an SSE event arrives. If no event or heartbeat arrives for 45 seconds, it aborts the current stream attempt so the existing reconnect loop can establish a fresh subscription.

This helps the web UI recover when a reverse proxy silently drops or stalls the /global/event SSE stream while the session continues running server-side.

How did you verify your code works?

  • cd packages/app && bun test --conditions=solid --preload ./happydom.ts src/context/server-sdk.test.ts --timeout 30000
  • bunx oxlint packages/app/src/context/server-sdk.tsx packages/app/src/context/server-sdk.test.ts
  • git diff --check

cd packages/app && bun run typecheck is currently blocked by the existing, unmodified src/custom-elements.d.ts file (../../ui/src/custom-elements.d.ts), which matches upstream/dev and fails before this change is typechecked.

Screenshots / recordings

N/A; this is an event-stream recovery fix.

Checklist

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

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

fix(app): recover from a silently dead event stream (PR #39349)

This PR appears to address the same or very similar issue. Both PRs focus on handling stale/dead event streams on the client side. Since PR #41002 is closing issue #40910 and PR #39349 deals with recovering from silently dead event streams, you should verify:

  1. Whether fix(app): recover from a silently dead event stream #39349 is already merged
  2. If it is, whether the current fix (fix(app): reconnect stale event streams #41002) adds additional improvements or uses a different approach
  3. If fix(app): recover from a silently dead event stream #39349 is still open, they may be addressing the same problem and should be consolidated

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 UI freezes mid-session behind nginx reverse proxy (SSE /global/event stream drops); page refresh required

2 participants