Skip to content
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

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

kdelemme
Copy link
Contributor

@kdelemme kdelemme commented Nov 1, 2023

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.

@kdelemme kdelemme self-assigned this Nov 1, 2023
@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.12.0 labels Nov 1, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

queryClient.invalidateQueries({ queryKey: sloKeys.rules(), exact: false });
return response;
},
cacheTime: 0,
Copy link
Contributor Author

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

@kdelemme kdelemme marked this pull request as ready for review November 1, 2023 14:49
@kdelemme kdelemme requested a review from a team as a code owner November 1, 2023 14:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

@simianhacker simianhacker self-requested a review November 1, 2023 16:04
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #51 / security APIs - Session Concurrent Limit Session Concurrent Limit cleanup should not clean up unauthenticated sessions

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 1.1MB 1.1MB -84.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @kdelemme

Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kdelemme kdelemme merged commit aab346e into elastic:main Nov 1, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 1, 2023
@kdelemme kdelemme deleted the fix/slo-list-cache branch November 1, 2023 21:28
delanni pushed a commit to delanni/kibana that referenced this pull request Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SLO] useFetchSloList caching issue
6 participants