Skip to content

fix(logout): purge the namespaced Cache API store on logout#41303

Open
rusackas wants to merge 1 commit into
masterfrom
fix/clear-client-state-on-logout
Open

fix(logout): purge the namespaced Cache API store on logout#41303
rusackas wants to merge 1 commit into
masterfrom
fix/clear-client-state-on-logout

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

GET responses carrying an ETag were persisted into the @SUPERSET-UI/CONNECTION Cache API namespace and retained across sessions, with no purge on logout.

The logout handler in RightMenu already cleared the persisted redux localStorage (which holds SQL Lab editor/results state) and session storage. This extends it to also delete the namespaced Cache API store, so cached GET responses are not retained on the device after the session ends. The deletion is best-effort (the promise is not awaited, since logout immediately navigates away) and uses the exported CACHE_KEY constant.

This completes the on-logout client-state clearing: localStorage['redux'] (already cleared), session storage (already cleared), and now the Cache API namespace.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — client-side cleanup behavior.

TESTING INSTRUCTIONS

The existing RightMenu logout test is extended to mock the Cache API and assert caches.delete('@SUPERSET-UI/CONNECTION') is called on logout (alongside the existing localStorage/sessionStorage assertions).

Run: cd superset-frontend && npm run test -- src/features/home/RightMenu.test.tsx

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

GET responses with an ETag were persisted into the @SUPERSET-UI/CONNECTION
Cache API namespace and retained across sessions, with no purge on logout. The
logout handler already cleared the persisted redux localStorage and session
storage; extend it to also delete the namespaced Cache API store so cached
responses are not retained on the device after the session ends.

Best-effort (the promise is not awaited since logout navigates away). Extends
the existing RightMenu logout test to assert the cache namespace is purged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rusackas rusackas added the asvs label Jun 23, 2026
@dosubot dosubot Bot added authentication Related to authentication change:frontend Requires changing the frontend labels Jun 23, 2026
@bito-code-review

bito-code-review Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #8ceda9

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/features/home/RightMenu.test.tsx - 1
    • Hardcoded string vs constant · Line 420-420
      Import `CACHE_KEY` from `@superset-ui/core` at the top of the test file and replace the hardcoded string literal `"@SUPERSET-UI/CONNECTION"` with `CACHE_KEY` in the assertion.
Review Details
  • Files reviewed - 2 · Commit Range: 67d861a..67d861a
    • superset-frontend/src/features/home/RightMenu.test.tsx
    • superset-frontend/src/features/home/RightMenu.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset-frontend/src/features/home/RightMenu.test.tsx
Comment thread superset-frontend/src/features/home/RightMenu.test.tsx
Comment thread superset-frontend/src/features/home/RightMenu.test.tsx
Comment thread superset-frontend/src/features/home/RightMenu.tsx
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.34%. Comparing base (3b46a5f) to head (67d861a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #41303   +/-   ##
=======================================
  Coverage   64.34%   64.34%           
=======================================
  Files        2653     2653           
  Lines      144952   144954    +2     
  Branches    33433    33434    +1     
=======================================
+ Hits        93273    93275    +2     
  Misses      49995    49995           
  Partials     1684     1684           
Flag Coverage Δ
javascript 68.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

asvs authentication Related to authentication change:frontend Requires changing the frontend size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants