-
Notifications
You must be signed in to change notification settings - Fork 26
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
STCOR-832 invalidate react-query cache on login, logout #1504
Conversation
Replaces PR #1457, which was just too cumbersome to rebase after all the work that came in STCOR-776 / PR #1463. Invalidate all react-query caches on login and logout. Because the RQ cache is persistent across sessions, it was possible that empty values were cached if a query returns 4xx when a session ended, and then (incorrectly) reused when the session restarted. Approach Pass `<QueryClient>` down from `<RootWithIntl>` to some of its children so they can clear the cache immediately after login and before logout. The exact locations of this logic in `<MainNavigation>` and `<SessionEventContainer>` are certainly debatable, but using existing components instead of embarking on a larger refactor does have merits. Refs STCOR-832
Bigtest Unit Test Results193 tests ±0 188 ✅ ±0 6s ⏱️ ±0s Results for commit 77bc926. ± Comparison against base commit 33669a3. This pull request removes 195 and adds 193 tests. Note that renamed tests count towards both.
This pull request removes 5 skipped tests and adds 5 skipped tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
🧹 😄
Quality Gate passedIssues Measures |
Replaces PR #1457, which was just too cumbersome to rebase after all the work that came in STCOR-776 / PR #1463.
Invalidate all react-query caches on login and logout. Because the RQ cache is persistent across sessions, it was possible that empty values were cached if a query returns 4xx when a session ended, and then (incorrectly) reused when the session restarted.
Approach
Pass
<QueryClient>
down from<RootWithIntl>
to some of its children so they can clear the cache immediately after login and before logout. The exact locations of this logic in<MainNavigation>
and<SessionEventContainer>
are certainly debatable, but using existing components instead of embarking on a larger refactor does have merits.Refs STCOR-832