fix(solid-query): strip promise field in hydratableObserverResult to …#10104
fix(solid-query): strip promise field in hydratableObserverResult to …#10104erikrahm wants to merge 2 commits intoTanStack:mainfrom
Conversation
…prevent SSR stream hang
The promise field from QueryObserver.getOptimisticResult() is a controlled Promise that may never resolve (e.g. when enabled: false). When included in the value returned from createResource's fetcher, Solid's SSR serialization waits for it indefinitely, causing the streaming response to never close.
This follows the same pattern as the existing refetch: undefined stripping.
🦋 Changeset detectedLatest commit: 6b3f382 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
📝 WalkthroughWalkthroughAdds a changeset documenting a patch fix for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎯 Changes
hydratableObserverResult()stripsrefetch,fetchNextPage, andfetchPreviousPageduring SSR, but doesn't strip thepromisefield fromQueryObserverResult.The
promisefield (fromQueryObserver.getOptimisticResult()) is a controlled Promise that may never resolve — for example whenenabled: false. When included in the value returned fromcreateResource's fetcher, Solid's SSR serialization waits for it indefinitely, causing the streaming response to never close (browser tab spinner spins forever).Fix: Add
promise: undefinedalongside the existingrefetch: undefined.Reproduction
useQuerywithenabled: false:document.readyStatestays 'loading' and the browser tabspinner spins forever
Any query that doesn't immediately fetch is affected, not just enabled: false. This includes queries where the server sets
enabled: !isServeras a global default.✅ Checklist
guide.
pnpm run test:pr.🚀 Release Impact
changeset.