Skip to content

Prevent streaming disconnects from crashing Node - #15437

Merged
brophdawg11 merged 2 commits into
v7from
brophdawg11/codex-v7-streaming-disconnect
Aug 27, 2026
Merged

Prevent streaming disconnects from crashing Node#15437
brophdawg11 merged 2 commits into
v7from
brophdawg11/codex-v7-streaming-disconnect

Conversation

@brophdawg11

Copy link
Copy Markdown
Contributor

Backport of #15324 to v7.

What does this change?

Prevents @react-router/node streaming disconnects from crashing the Node process when a destination writable closes or is destroyed while a readable stream is active.

Benign writable closures cancel upstream reads without propagating a synthetic error, while genuine stream failures continue to preserve their error behavior. Cleanup also handles writable errors that are already pending.

Testing

  • pnpm test packages/react-router-node/__tests__/stream-test.ts
  • ESLint and Prettier checks for changed files
  • pnpm run --filter react-router build
  • pnpm run --filter @react-router/node typecheck

(cherry picked from commit 1401852)
Assisted-By: devx/58de020f-a53b-4434-bdad-a50684884b0a
@github-actions

Copy link
Copy Markdown
Contributor

Preview Build Available

Preview builds have been created for this PR. You can install react-router using:

pnpm install "remix-run/react-router#preview/pr-15437&path:packages/react-router"

And/or install other packages via:

pnpm install "remix-run/react-router#preview/pr-15437&path:packages/react-router-dev"
pnpm install "remix-run/react-router#preview/pr-15437&path:packages/react-router-express"
pnpm install "remix-run/react-router#preview/pr-15437&path:packages/react-router-node"
pnpm install "remix-run/react-router#preview/pr-15437&path:packages/react-router-serve"

These preview builds will be updated automatically as you push new commits.

@brophdawg11
brophdawg11 merged commit dd336cf into v7 Aug 27, 2026
6 checks passed
@brophdawg11
brophdawg11 deleted the brophdawg11/codex-v7-streaming-disconnect branch August 27, 2026 20:03
@ryanflorence ryanflorence mentioned this pull request Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The preview branch preview/pr-15437 has been deleted now that this PR is merged/closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client abort mid-stream can crash the Node process: unhandled 'error' from writable.destroy() after monitor cleanup (@react-router/node >= 8.0.0)

1 participant