Skip to content

Fix/nuclearpurge localstorage - #664

Merged
utksh1 merged 5 commits into
utksh1:mainfrom
vedasingh00-rgb:fix/nuclearpurge-localstorage
Jun 8, 2026
Merged

Fix/nuclearpurge localstorage#664
utksh1 merged 5 commits into
utksh1:mainfrom
vedasingh00-rgb:fix/nuclearpurge-localstorage

Conversation

@vedasingh00-rgb

Copy link
Copy Markdown
Contributor

Description

The handleNuclearPurge function was calling localStorage.clear() which wiped all browser storage indiscriminately, including keys that don't belong to SecuScan. This fix replaces it with a targeted approach that only removes SecuScan-owned keys.

Related Issues

Closes #464

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added a unit test in SettingsSaveReset.test.tsx that:

  • Sets up SecuScan-owned keys (secuscan-config, secuscan_api_key, secuscan-saved-views, sidebar-expanded) and an unrelated key (some-other-app-key).
  • Triggers the Nuclear Purge and confirms the action.
  • Verifies all SecuScan keys are removed.
  • Verifies the unrelated keys are preserved.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

@vedasingh00-rgb

Copy link
Copy Markdown
Contributor Author

Hi @utksh1 , I have addressed the issue. Could you please review the PR when you get a chance?

@utksh1 utksh1 added level:beginner 20 pts difficulty label for small beginner-friendly PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label area:frontend Frontend React/UI work gssoc:approved Admin validation: approved for GSSoC scoring labels Jun 8, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approved. The purge action now removes SecuScan-owned localStorage keys without clearing unrelated browser storage, and the behavior is covered by a focused Settings test. CI is green.

@utksh1
utksh1 merged commit 975da20 into utksh1:main Jun 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Frontend React/UI work gssoc:approved Admin validation: approved for GSSoC scoring level:beginner 20 pts difficulty label for small beginner-friendly PRs type:bug Bug fix work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Settings purge should only remove SecuScan localStorage keys

2 participants