Repository navigation
fix(router-ssr-query-core): drop the query stream reader instead of releasing it - #8796
EmilEinarsen wants to merge 1 commit into
Conversation
…eleasing it WebKit's releaseLock() can deadlock with a garbage collection and freeze the page after hydration. Fixes TanStack#8795
🦋 Changeset detectedLatest commit: 055ce1c The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
🎯 Changes
Fixes #8795.
Hydration no longer calls
reader.releaseLock()when the dehydrated query stream ends. In WebKit,releaseLock()can deadlock with a garbage collection and freeze the page right afterload. Details and a repro are in the issue.The loop only exits once the stream is done or the reader has been cancelled. Nothing else reads the stream after that, so the reader is dropped instead of released.
Tests: the three
stream.locked === falseassertions are gone. The hydration test now assertsreleaseLock()is not called, and fails against the old code.I have seen the freeze only in Playwright's WebKit on Linux. I don't know whether Safari is affected.
Drafted with AI assistance.
✅ Checklist
Ran on Windows for this package only: unit tests (vitest), eslint, and
tsc/tsc6type checks. I did not run the fullpnpm test:eslint/test:types/test:unitacross affected packages; a full install fails on Windows (an e2e postinstall uses POSIX env syntax).🚀 Release Impact
Summary by CodeRabbit