Repository navigation
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
3 of 6 tasks
This branch has not been deployed
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.
Issue for this PR
Closes #36311
Supersedes #50375 (that one targets
dev; the same missing bridge is present onv2).Type of change
What does this PR do?
On Bun 1.3.14,
node:httpdoes not emitServerResponse"close" when an SSE client disconnects (oven-sh/bun#14697).@effect/platform-nodewaits for that event to interrupt the request fiber, so when a TUI drops its/api/eventSSE connection the server-side event stream is never released. It keeps writing heartbeats into a dead socket, pinning one CPU core at 100% and making the server unresponsive.packages/server/src/process.tsis thev2equivalent of thedevcall site the issue describes. This adds the bridge the issue suggests: on Bun only, destroy the response from the request "aborted" event so Bun emits the missing "close" and Effect can interrupt the stream and release its subscription.The bridge is a small named function (
bridgeSseDisconnect) next tobindso its two guards — Bun only, and only for a response that has not already ended — are directly testable.How did you verify your code works?
bun test test/process.test.tsfrompackages/server— 4 pass. Two new cases drive a fake"request"emission and then"aborted": an unfinished response is destroyed, an already-ended response is left alone. The existing live server tests still pass.bun typecheckinpackages/server— passed.bun run lint— 0 warnings / 0 errors.The original report notes there is no short deterministic trigger for the permanent spin, so this is covered at the event-bridge level rather than by reproducing the spin end to end.
Note:
bun run checkstill cannot complete in my Windows checkout becausepackages/app/src/custom-elements.d.tsis a git symlink (mode 120000) materialized as a text file (core.symlinks=false), which fails@opencode/app#typecheckwith TS1128. That is unrelated to this change and passes on a normal checkout.Screenshots / recordings
Not applicable; no UI change.
Checklist