-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(core): staleTime: 'static' #9139
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
base: main
Are you sure you want to change the base?
Conversation
previously, it didn't matter if we included `stale: true` or not in the filters for refetch, because marking things with query.invalidate() would set them all to stale anyway. Now, queries with StaleTime.Static will be marked as `invalidated`, but still shouldn't be refetched. The `isStale` filter logic accounts for that, so we have to include it in the filters
check for observers first because they contain the source of truth calculated with `isStaleByTime`, and it also takes enabled into account
we have to check for undefined data first, because queries without data are really always stale; then, the next check must be against StaleTime.Static, because queries that are marked as invalidated are still not stale, even if they are static.
View your CI Pipeline Execution ↗ for commit 5d2114c.
☁️ Nx Cloud last updated this comment at |
this ensures we never refetch Static queries
Sizes for commit 5d2114c:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9139 +/- ##
===========================================
+ Coverage 44.49% 58.81% +14.32%
===========================================
Files 206 138 -68
Lines 8150 5405 -2745
Branches 1823 1440 -383
===========================================
- Hits 3626 3179 -447
+ Misses 4081 1926 -2155
+ Partials 443 300 -143 🚀 New features to boost your workflow:
|
@TkDodo In my opinion, if "static" is added, it would be better if explicit changes were added to devtools accordingly. What do you think? If you think it's necessary, I'd like to pull this branch and work on it as a new PR. |
yeah we could make a separate label like we have for |
OK, I'll work on it as soon as possible. |
No description provided.