Skip to content

fix: follow the upstream review of the react-router 8.4.0 patch - #6

Merged
Mheaus merged 1 commit into
mainfrom
fix/patch-react-router-cancel-rsc-stream
Oct 10, 2026
Merged

Mheaus merged 1 commit into
mainfrom
fix/patch-react-router-cancel-rsc-stream

Conversation

@Mheaus

@Mheaus Mheaus commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Updates patches/react-router@8.4.0.patch to match the latest commit of remix-run/react-router#15612:

  • When an enqueue in writeRSCStream fails, its finally releases the reader. stop() could then not cancel the RSC stream, so the RSC render kept running for nothing (no crash). stop() now calls rscStream.cancel() when the stream is no longer locked.
  • In production the RSC stream is a tee() branch, and its cancel waits for the other branch. stop() now unblocks flush() before it cancels the RSC stream. Before this, an abort during flush() kept the response open until the RSC render ended.

Verification on the demo production build, with requests that the client aborts after 1–30 ms:

  • 300 requests, one at a time: 0 stops;
  • 1,000 requests, 20 in parallel: 0 stops, no error in the log.

@Mheaus
Mheaus merged commit ce9a55c into main Oct 10, 2026
3 checks passed
@Mheaus Mheaus changed the title fix: follow the upstream review, cancel the RSC stream after its reader is released fix: follow the upstream review of the react-router 8.4.0 patch Oct 10, 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.

1 participant