-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: no hydration when new promise comes in #8383
Conversation
View your CI Pipeline Execution ↗ for commit 8c2023e.
☁️ Nx Cloud last updated this comment at |
before digging deeper, can you confirm if this is a bug or expected @TkDodo ? I think we might not be in a pending state so the promise doesn't get sent down? |
// --- server --- | ||
countRef.current++ | ||
const promise2 = serverQueryClient.prefetchQuery(query) | ||
|
||
const dehydrated2 = dehydrate(serverQueryClient) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assume this is a server fn calling revalidatePath()
so the page re-renders
you’re right: we only send the promise when we are in |
feels like we need some other state that would let us know if the promise is fresher then we need to set the queries' promise or something.. this goes deeper than I thought |
I'd say if we get a promise, we should always assume it's newer and hydrate its data, no? |
how do we check for that wihtout causing infinite re-renders in |
struggling to figuring out how to properly filter out the queries to put in the hydration queue CleanShot.2024-12-02.at.21.01.26.mp4 |
@juliusmarminge have you widened this check? query/packages/react-query/src/HydrationBoundary.tsx Lines 74 to 76 in 8fe9010
to something like:
so that whenever a promise is included, we put it the queue. |
yea that causes infinite rerenders |
interesting; let’s debug that together today if you have some time? |
sure! what time? I can sneak in a short seesion anytime after 10am gmt+1. |
I pinged you on discord ;) |
I wish I knew 😂. How can we find out? |
I was able to find the error by passing ![]()
Possibly related to vercel/next.js#65447
Seems like something with Next.js 15 |
|
Hmm seems like the CI test run is running out of memory 👀 https://cloud.nx.app/runs/Qjh3Jk3Wxc/task/%40tanstack%2Freact-query%3Atest%3Alib |
seems like we’re running into out of memory:
let’s try setting more memory for the test run: 71a4453 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8383 +/- ##
===========================================
+ Coverage 46.25% 63.06% +16.80%
===========================================
Files 199 135 -64
Lines 7534 4852 -2682
Branches 1721 1365 -356
===========================================
- Hits 3485 3060 -425
+ Misses 3670 1547 -2123
+ Partials 379 245 -134 |
Thank you @juliusmarminge and @TkDodo for all the work to get his fixed! We appreciate the hard work! |
No description provided.