Avoid Node localStorage warnings in extension tests#348
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 11:57 PM ET / 03:57 UTC. Summary Reproducibility: yes. Source inspection shows current main directly touches warning-prone localStorage paths, and the focused reproduction is the PR's Node 26 trace-warnings Vitest command. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused storage-helper change through normal maintainer review so Node tests avoid warning noise while browser extension storage behavior stays intact. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main directly touches warning-prone localStorage paths, and the focused reproduction is the PR's Node 26 trace-warnings Vitest command. Is this the best way to solve the issue? Yes. The shared accessor is the narrowest maintainable fix I found: it avoids getter invocation in Node while preserving browser window.localStorage and explicit value-style test stubs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 206a6f844764. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
globalThis.localStoragein Vitest, which otherwise emitsExperimentalWarning: localStorage is not available because --localstorage-file was not provided.window.localStoragein real browser contexts and preserving explicit value-style test stubs.Behavior proof
Before this change, running the focused suite with
NODE_OPTIONS=--trace-warningsemitted Node 26 warnings fromsettings-storage.tsandfeedback-runtime.ts.With this change, the same focused suite completes cleanly under
NODE_OPTIONS=--trace-warningswith no warning lines emitted:Validation
NODE_OPTIONS=--trace-warnings pnpm exec vitest run tests/chrome.storage-fallback.test.ts tests/sidepanel.slides-stream-controller.test.ts tests/sidepanel.stream-controller.error.test.ts tests/chrome.extractor-router.test.ts tests/sidepanel.presentation-runtime.test.ts tests/sidepanel.model-presets.test.ts --pool=forks --maxWorkers=1 --testTimeout=15000pnpm -s checkpnpm -C apps/chrome-extension build