fix (SSE): Prevent heartbeat from aborting in-progress connections#8783
Merged
ericpgreen2 merged 10 commits intomainfrom Feb 5, 2026
Merged
fix (SSE): Prevent heartbeat from aborting in-progress connections#8783ericpgreen2 merged 10 commits intomainfrom
ericpgreen2 merged 10 commits intomainfrom
Conversation
This reverts commit a719a8c.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
briangregoryholmes
approved these changes
Feb 5, 2026
ericpgreen2
added a commit
that referenced
this pull request
Feb 5, 2026
…8783) * fix (SSE): Send server keep-alives * Push a devcontainer for testing * Bump devcontainer's Node heap size * Fix devcontainer's Go version * Add debugging logs * Modify devcontainer so I can upload my own binary * Fix heartbeat triggering reconnect during CONNECTING state * Revert "fix (SSE): Send server keep-alives" This reverts commit a719a8c. * Remove SSE debugging logs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove devcontainer (moved to separate PR) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
ericpgreen2
added a commit
that referenced
this pull request
Feb 5, 2026
…8783) * fix (SSE): Send server keep-alives * Push a devcontainer for testing * Bump devcontainer's Node heap size * Fix devcontainer's Go version * Add debugging logs * Modify devcontainer so I can upload my own binary * Fix heartbeat triggering reconnect during CONNECTING state * Revert "fix (SSE): Send server keep-alives" This reverts commit a719a8c. * Remove SSE debugging logs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove devcontainer (moved to separate PR) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
The
heartbeatfunction is called on every user interaction (click, keydown, focus) to manage our SSE connection lifecycle. Previously, it would triggerreconnect()regardless of connection state, which caused problems during theCONNECTINGphase—the in-progress connection would be aborted, burning through retry attempts until the max was exceeded, resulting in the "Error connecting to runtime" error page.This is a latency-dependent race condition: locally, connections establish fast enough that the
CONNECTINGwindow is rarely hit. Behind proxies (Cloudflare, Codespaces), added latency widens this window, causing user interactions during page load to abort connections consistently.This fix makes
heartbeat()only trigger reconnect when the connection isPAUSED(intentionally disconnected to save resources), not whenCONNECTING(already in progress) orCLOSED(fatal error).I've tested this PR in GitHub Codespaces. See PR #8784 for the devcontainer setup.
Closes APP-719
Checklist: