Skip to content

Avoid Node localStorage warnings in extension tests#348

Open
vincent-peng wants to merge 1 commit into
steipete:mainfrom
vincent-peng:codex/node26-localstorage-warning
Open

Avoid Node localStorage warnings in extension tests#348
vincent-peng wants to merge 1 commit into
steipete:mainfrom
vincent-peng:codex/node26-localstorage-warning

Conversation

@vincent-peng

@vincent-peng vincent-peng commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a small storage helper for extension fallback storage access.
  • Avoid touching Node 26's getter-only globalThis.localStorage in Vitest, which otherwise emits ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
  • Keep browser behavior unchanged by using window.localStorage in real browser contexts and preserving explicit value-style test stubs.

Behavior proof

Before this change, running the focused suite with NODE_OPTIONS=--trace-warnings emitted Node 26 warnings from settings-storage.ts and feedback-runtime.ts.

With this change, the same focused suite completes cleanly under NODE_OPTIONS=--trace-warnings with no warning lines emitted:

$ 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=15000

 RUN  v4.1.9 summarize

 Test Files  6 passed (6)
      Tests  27 passed (27)
   Start at  13:37:01
   Duration  2.06s (transform 398ms, setup 32ms, import 524ms, tests 337ms, environment 378ms)

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=15000
  • pnpm -s check
  • pnpm -C apps/chrome-extension build

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 11:57 PM ET / 03:57 UTC.

Summary
The branch adds a Chrome extension localStorage helper, switches fallback storage call sites to it, and adds a Vitest regression for getter-only Node localStorage globals.

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.

  • Changed surface: 7 files, +79/-11. The patch is small but touches shared extension fallback storage plus options and sidepanel call sites.
  • Visible validation proof: 6 test files, 27 tests passed. The PR body includes copied live trace-warnings output for the focused warning path.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No automated repair is needed; the PR has sufficient proof and no blocking findings, so the next step is ordinary maintainer review.

Security
Cleared: No concrete security or supply-chain concern was found; the diff only adds a local helper, adjusts extension storage access, and updates tests.

Review details

Best 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 changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live terminal output from the focused Vitest command under NODE_OPTIONS=--trace-warnings showing the after-fix suite passing without warning lines.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied live terminal output from the focused Vitest command under NODE_OPTIONS=--trace-warnings showing the after-fix suite passing without warning lines.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a low-risk extension test-warning cleanup and fallback hardening PR with no user-facing outage evidence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes copied live terminal output from the focused Vitest command under NODE_OPTIONS=--trace-warnings showing the after-fix suite passing without warning lines.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes copied live terminal output from the focused Vitest command under NODE_OPTIONS=--trace-warnings showing the after-fix suite passing without warning lines.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Current blame and history for the fallback storage, options tab, and sidepanel runtime paths point to Peter Steinberger across the touched Chrome extension files. (role: recent area contributor; confidence: high; commits: 288bec056698, c2196fe72431, c4814b2dc201; files: apps/chrome-extension/src/lib/settings-storage.ts, apps/chrome-extension/src/entrypoints/options/tab-controller.ts, apps/chrome-extension/src/entrypoints/sidepanel/feedback-runtime.ts)
  • vincent-peng: Vincent has prior merged extension-adjacent work in repository history and authored the current focused fix, though the central storage paths are primarily from Peter's history. (role: adjacent extension contributor; confidence: medium; commits: 351a8fd57c99, f42114e2332f; files: apps/chrome-extension/src/entrypoints/hover.content.ts, apps/chrome-extension/src/lib/sse.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (3 earlier review cycles)
  • reviewed 2026-07-08T03:06:45.919Z sha 5934cab :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-08T03:43:24.957Z sha 5934cab :: needs maintainer review before merge. :: none
  • reviewed 2026-07-08T03:48:11.968Z sha 5934cab :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jul 8, 2026
@vincent-peng

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@vincent-peng vincent-peng marked this pull request as ready for review July 8, 2026 03:46
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant