Skip to content

feat(storage): add --max-storage-value flag - #703

Open
moonD4rk wants to merge 2 commits into
mainfrom
feat/configurable-storage-value-limit
Open

moonD4rk wants to merge 2 commits into
mainfrom
feat/configurable-storage-value-limit

Conversation

@moonD4rk

@moonD4rk moonD4rk commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Part of #238 — configurable localStorage/sessionStorage value size limit.

What

  • New --max-storage-value on dump and restore (default 2048, 0 = unlimited, negative rejected).
  • Counts decoded characters (was raw bytes), applied uniformly as each record is collected, to localStorage and sessionStorage across Chromium, Firefox and Safari. Previously each browser hardcoded a 2 KB byte cap — and Firefox localStorage / Chromium sessionStorage weren't capped at all — so behaviour diverged.
  • Off-by-one fixed: a value of exactly the limit is kept (was rejected by >=).

Behaviour change

Firefox localStorage and Chromium sessionStorage, previously uncapped, now follow the same 2048-char default.

Follow-ups (not in this PR)

base64 export of binary values (also in the issue) needs byte-faithful raw-value plumbing. Refs #238, kept open.

Test

go test ./... green (goldens regenerated); golangci-lint clean; cross-compiles linux/windows/darwin.

The localStorage cap was hardcoded at 2048 raw bytes and handled
separately in Chromium and Safari. Move it to the app layer as a
configurable char limit (0 = unlimited) for local and session storage.
Copilot AI balanced review requested due to automatic review settings November 18, 2026 07:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Add --max-storage-value to restore (the truncation hint named a flag it
lacked), cap values in collector.Add instead of after the whole
extraction, and reject a negative limit instead of silently unlimiting.
@moonD4rk
moonD4rk added this pull request to stack #706 November 18, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants