-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
UpsertQueryEntries breaks query invalidation when the invalidationBehavior is set to delayed #4749
Comments
I experienced the same issue. The issue here seems to be that the when As you can see in the Redux Browser Devtools, these are all upserted query entries that stay in Since In my opinion, an upserted query entry should always directly be in |
Yeah, those definitely should not be in Could someone provide a small repro that shows this happening? That would save me some time trying to fix this. |
Hey @markerikson , thanks for the fast reply! |
Okay, made a Replay that shows that repro in action: Looks like there was a small flaw in the logic. We already had a check for the Meanwhile, the substate.requestId =
upserting && substate.requestId
? // for `upsertQuery` **updates**, keep the current `requestId`
substate.requestId
: // for normal queries or `upsertQuery` **inserts** always update the `requestId`
meta.requestId So, what was happening was roughly:
and so we're left with the existing entry, updated to be in a Put up #4768 with the fix . I can publish it shortly, but just to check, could someone try out the PR preview build and see if that resolves things on your end? |
Hey @markerikson thank you for the immediate fix. |
Thanks for taking care of it! |
Steps:
Expected result:
data returned by the useGetQueryQuery() is re-fetched
Actual Result:
the data is not re-fetched
The text was updated successfully, but these errors were encountered: