-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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(slo): remove react query cache for slo list page #170318
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
queryClient.invalidateQueries({ queryKey: sloKeys.rules(), exact: false }); | ||
return response; | ||
}, | ||
cacheTime: 0, |
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.
💬 Only change is here.
Added cacheTime, removed staleTime and keepPreviousData
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
To update your PR or re-run it, just comment with: cc @kdelemme |
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.
LGTM
Resolves #170317
🥡 Summary
When changing pages, we observed a weird behaviour where the result of the API was not fully taken into account, and was kind of merged with the previous results. After some investigation, it seems the cacheTime (default to 5min) was problematic in our case.
This PR forces
cacheTime
to 0, so when changing page, we only use the result from the API.