Skip to content

Report partial CDP storage restores and preserve snapshots - #2547

Open
Ethereal49 wants to merge 1 commit into
vercel-labs:mainfrom
Ethereal49:fix/restore-localstorage-2543
Open

Ethereal49 wants to merge 1 commit into
vercel-labs:mainfrom
Ethereal49:fix/restore-localstorage-2543

Conversation

@Ethereal49

Copy link
Copy Markdown

Problem

With Lightpanda 1.0.3 attached over CDP, --restore saves both a cookie and localStorage on the first close. Reopening the session restores the cookie, but Lightpanda does not implement DOMStorage.setDOMStorageItem. The CLI reports loaded without a reason, and the next close overwrites the snapshot with origins: [].

Changes

  • Keep writing storage through CDP where supported. When an origin cannot be restored, report the origin and the reason in CLI and MCP output. The existing skipped-origin arrays remain available.
  • Report loaded_partial when storage is skipped. With the default --restore-save auto policy, keep the original snapshot after a partial restore.
  • Document the JSON diagnostics and save policy.

Verification

  • The mock CDP regression failed on the baseline and passes with this change. It covers successful DOMStorage writes and an unsupported method.
  • Reproduced the issue with the official Lightpanda 1.0.3 macOS ARM64 binary over external CDP. Verified that the cookie returns, CLI stderr and MCP report the skipped origin and reason, and a second close preserves the original snapshot.
  • Targeted Rust tests and four real-Chrome state and restore tests passed.
  • Docs tests, type check, production build, and route tests passed.

NOT_RUN: The exact Debian 13 Crostini environment and the full Rust suite.

Fixes #2543.

Implemented with Codex (AI-assisted).

@vercel

vercel Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

@Ethereal49 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

Lightpanda CDP: --restore saves cookies but omits localStorage (origins: [])

1 participant