-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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(react-query): make sure promises are always finalized #8211
Conversation
otherwise, there can be cases with multiple observers where we have listeners already, but still need to finalize
☁️ Nx Cloud ReportCI is running/has finished running commands for commit ef9efc2. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8211 +/- ##
=========================================
+ Coverage 0 81.79% +81.79%
=========================================
Files 0 26 +26
Lines 0 357 +357
Branches 0 97 +97
=========================================
+ Hits 0 292 +292
- Misses 0 56 +56
- Partials 0 9 +9
|
@@ -150,10 +150,8 @@ export function useBaseQuery< | |||
client.getQueryCache().get(defaultedOptions.queryHash)?.promise | |||
|
|||
promise?.catch(noop).finally(() => { | |||
if (!observer.hasListeners()) { |
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.
Wow, I should know by now not to do premature optimizations 😬
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.
😂 seems like we removed all the checks that were initially added because we found a case where that broke it
otherwise, there can be cases with multiple observers where we have listeners already, but still need to finalize