fix(query): Update notifyManager scheduler to use queueMicrotask#111187
Merged
fix(query): Update notifyManager scheduler to use queueMicrotask#111187
Conversation
JonasBa
approved these changes
Mar 23, 2026
TkDodo
added a commit
that referenced
this pull request
Mar 24, 2026
…on page (#111204) for forms where we stay on the same page (no modals that close, no redirects), we should reset the form after the source of `defaultValues` (usually a query or a store) has been updated. while the defaultValues are reactive by themselves, they only get applied if the form is `pristine`. That means the `value` won’t change. Now that might not be a problem if the server returns the same values, but if it doesn’t, we’d want to see the server values here. I’ve simulated this in the story where the mutation returns the input as `toUpperCase()`, so that we can see what’s happening. This also means if you only make a mutation and forget to update the query, or if you don’t return the invalidation from the mutation, the values will “flicker” back to the old initial state. This is intended because it serves as a reminder that the corresponding query / store needs to be updated. For AutoSaveForms, we’re doing this internally. Note: The reset is timing sensitive. If it happens too early, there will be a flash of old initialData briefly. That’s why this PR is dependent upon: - #111187
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see the code comment for motivation