fix(reset): clear the asset-icon cache on wallet reset - #121
Conversation
|
@claude review |
|
Claude finished @dmnyc's task in 6m 29s —— View job Code review
The icon-cache fix is the right shape and the reasoning in the comments is good throughout. One finding below is significantly more serious than the stated scope of this PR, and it's in the offscreen commit that's riding along. Note up front: this branch carries 6 commits across 5 unrelated concerns (offscreen sender gate, keystore throttle, WAR dynamic URL, two approval-display changes, icon cache), but the title and body only describe the icon cache. Flagging for reviewability — reviewers filtering on the description will skim past the security-relevant one. CI: Provider conformance passed on this branch, which meaningfully de-risks the 🔴 The offscreen sender gate doesn't close the hole it describes
if (sender.id !== browser.runtime.id) return false;
The exposed surface is This hole predates the PR; the commit just doesn't close it. Two changes: // offscreen.ts — mirror the background gate fully, not just the id half
const EXT_ORIGIN = new URL(browser.runtime.getURL("/")).origin;
if (sender.origin !== EXT_ORIGIN || sender.id !== browser.runtime.id) return false;// content.ts:82 — routing keys are never page-supplied
if (k !== "type" && k !== "source" && k !== "target") safeParams[k] = v;One link I could not verify statically here (no deps installed in this checkout): that a content-script 🟠 Icon-cache cleanup can block the wipe
await clearAssetIconCache();
return keystore.reset();The icon cache is the least important thing in this handler, but it's now a hard Either move it after 🟠
|
3318abe to
0ae6d7c
Compare
|
Review feedback addressed in 632ff00:
|
Fixes #106 (L-8).
apogee:asseticon:<assetId>keys persist which non-LBTC assets the wallet displayed, andwallet/resetdidn't remove them — a holdings fingerprint survived the wipe.clearAssetIconCache()now drops every cached icon (and the in-memory negative cache) as part of reset, alongside the keystore, scan-state, and idempotency cleanup.setActiveWalletis unwired today; wallet-switch cleanup can ride along when it's exposed.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.