fix(core): make sure that calling setOptions will always notifyListeners#8771
Merged
fix(core): make sure that calling setOptions will always notifyListeners#8771
Conversation
we have an optimized `shouldNotifyListeners` logic internally in the QueryObserver that will make sure we only notify listeners that are interested in a change because they are using a specific key (tracked query properties) the optimization to force a skip of the notification when updating options because the optimistic result should already contain all the necessary output falls apart in the situation described in the test and in the linked issue #8741. while the issue itself is a niche edge-case, the fix is to actually remove a bunch of code, so I'm all for it
|
View your CI Pipeline Execution ↗ for commit ab0ff6c.
☁️ Nx Cloud last updated this comment at |
Contributor
|
Sizes for commit ab0ff6c:
|
TkDodo
commented
Mar 8, 2025
Collaborator
Author
There was a problem hiding this comment.
@lachlancollins for the svelte-query persist plugin, there seems to now be one additional render / update. Interestingly, this doesn’t happen for the react adapter. we have the same tests and had the same assertions until now.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8771 +/- ##
===========================================
+ Coverage 46.60% 63.39% +16.78%
===========================================
Files 200 136 -64
Lines 7576 4860 -2716
Branches 1744 1371 -373
===========================================
- Hits 3531 3081 -450
+ Misses 3669 1538 -2131
+ Partials 376 241 -135 🚀 New features to boost your workflow:
|
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.
we have an optimized
shouldNotifyListenerslogic internally in the QueryObserver that will make sure we only notify listeners that are interested in a change because they are using a specific key (tracked query properties)the optimization to force a skip of the notification when updating options because the optimistic result should already contain all the necessary output falls apart in the situation described in the test and in the linked issue #8741.
while the issue itself is a niche edge-case, the fix is to actually remove a bunch of code, so I'm all for it
fixes #8741