Skip to content

fix(miner-extension): purge a stale discoveryIndexUrl value from chrome.storage.sync - #5511

Merged
JSONbored merged 1 commit into
mainfrom
fix/clear-stale-discovery-index-url
Jul 13, 2026
Merged

fix(miner-extension): purge a stale discoveryIndexUrl value from chrome.storage.sync#5511
JSONbored merged 1 commit into
mainfrom
fix/clear-stale-discovery-index-url

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

#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.

Scope

  • In scope (apps/gittensory-miner-extension/, test/, plus the required generated-doc regeneration), narrow
  • No secrets/private terms
  • General fix (purges the key from every load/save path), not a special-cased one-off

Validation

  • npx vitest run test/unit/miner-extension-content.test.ts — 12/12 passing
  • npm run build:miner — clean
  • npm run test:ci — full local gate green (795 test files / 15432 tests passed, 12 skipped)
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Confirmed via git show origin/main:...options.js that the gap is still open on current main (no purge call anywhere)

Safety

  • No secrets in code/comments/tests
  • chrome.storage.sync.remove on an already-absent key is a documented no-op — safe to call unconditionally on every load/save

…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.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent did not find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (97476d9) to head (d174f3f).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
shard-1 43.78% <ø> (-0.51%) ⬇️
shard-2 35.40% <ø> (+0.05%) ⬆️
shard-3 32.09% <ø> (+0.15%) ⬆️
shard-4 31.37% <ø> (-0.58%) ⬇️
shard-5 33.32% <ø> (+0.38%) ⬆️
shard-6 43.81% <ø> (+0.27%) ⬆️

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit ec7d4c2 into main Jul 13, 2026
17 checks passed
@JSONbored
JSONbored deleted the fix/clear-stale-discovery-index-url branch July 13, 2026 00:01
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant