fix(miner-extension): purge a stale discoveryIndexUrl value from chrome.storage.sync - #5511
Merged
Merged
Conversation
…me.storage.sync #5343 removed the discoveryIndexUrl UI field and stopped reading/writing it, but chrome.storage.sync.set only merges keys -- it never deletes ones an earlier extension version already synced. Without an active purge, a value synced before #5343 stays in a user's account indefinitely, which is a real privacy/data-retention gap #5343 didn't close. Add removeLegacyDiscoveryIndexUrl(), called from refreshSettings() (which runs on every options-page load and again at the end of every save), so any stale value is cleared regardless of which path a user hits first. Extends the existing dead-field regression test with coverage for the purge on both load and save. Also regenerates packages/gittensory-miner/docs/env-reference.md, which was already stale on main (GITTENSORY_MINER_KILL_SWITCH from #5198/#5500 was never regenerated in) -- unrelated to this fix but required for miner:env-reference:check to pass in this PR's own CI; also fixed standalone in #5507.
Contributor
|
Superagent did not find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5511 +/- ##
=======================================
Coverage 94.75% 94.75%
=======================================
Files 565 565
Lines 44914 44914
Branches 14675 14675
=======================================
Hits 42559 42559
Misses 1621 1621
Partials 734 734
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#5343 removed the
discoveryIndexUrlUI field and stopped reading/writing it, butchrome.storage.sync.setonly merges keys — it never deletes ones an earlier extension version already synced. Without an active purge, a value synced before #5343 stays in a user's account indefinitely, which is a real privacy/data-retention gap #5343 didn't close.removeLegacyDiscoveryIndexUrl()toapps/gittensory-miner-extension/options.js, called fromrefreshSettings()(which runs on every options-page load and again at the end of every save), so any stale value is cleared regardless of which path a user hits first.test/unit/miner-extension-content.test.tswith coverage for the purge on both load and save, plus a direct check that the internal helper is exposed for testing.packages/gittensory-miner/docs/env-reference.md, which was already stale onmain(GITTENSORY_MINER_KILL_SWITCHfrom Document and test.gittensory-miner.ymlconfig precedence against MINER_* env vars and CLI flags #5198/docs(miner): document and test .gittensory-miner.yml config precedence (#5198) #5500 was never regenerated in) — unrelated to this fix but required forminer:env-reference:checkto pass in this PR's own CI. Also fixed standalone in docs(miner): regenerate env-reference.md for GITTENSORY_MINER_KILL_SWITCH #5510, so this hunk will disappear on rebase once that merges.Scope
apps/gittensory-miner-extension/,test/, plus the required generated-doc regeneration), narrowValidation
npx vitest run test/unit/miner-extension-content.test.ts— 12/12 passingnpm run build:miner— cleannpm run test:ci— full local gate green (795 test files / 15432 tests passed, 12 skipped)npm audit --audit-level=moderate— 0 vulnerabilitiesgit show origin/main:...options.jsthat the gap is still open on current main (no purge call anywhere)Safety
chrome.storage.sync.removeon an already-absent key is a documented no-op — safe to call unconditionally on every load/save