Skip to content

Persist embedded browser sessions across tabs and app restarts - #152

Open
katulevskiy wants to merge 16 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/573
Open

katulevskiy wants to merge 16 commits into
mirror/upstream-mainfrom
mirror/upstream-pr/573

Conversation

@katulevskiy

Copy link
Copy Markdown
Owner

Upstream mirror

Source: zeronsh#573
Original author: @jsgrrchg
Original revision: 515642b2cfeb7636b99cd190124914e0eedf6562

This PR is an isolated Contribution Manager pilot mirror. Its reviews, checks and merge state are separate from upstream. An empty [skip ci] commit suppresses automatic bulk CI; the code tree matches the imported upstream revision.


Embedded browser logins are currently lost when Zeron restarts, and on Linux also when the last browser tab closes. This change reopens persistent website data for the same Zeron profile on Linux and macOS 14+, so valid persistent sessions survive both actions.

  • Derive stable, device-local browser identities from workspace scope and user/organization or local device identity. Share contexts between tabs and windows, and isolate different profiles.
  • Store Linux website data and SQLite cookies in profile-specific directories, with a process lock and orderly helper shutdown.
  • Use named persistent WKWebsiteDataStore instances on macOS 14+. Keep isolated temporary stores on macOS 12/13 and show a compatibility notice.
  • Initialize the Linux helper off the UI thread, including extraction, profile coordination and the startup handshake. Deliver readiness/errors asynchronously, load the latest requested URL, and cancel attachment when a pending tab closes.
  • Add storage and startup regression tests, native fixture coverage in Linux/macOS CI, and profile lifecycle documentation.

Validation

  • cargo check --locked -p zeron-ui --tests --example browser-fixture --features browser-fixture passed.
  • cargo test --locked -p zeron-ui --lib browser --features browser-fixture -- --test-threads=1 passed: 21 tests, with the display-dependent lifecycle test ignored in this run. That lifecycle test also passed separately under Xvfb during implementation.
  • The real Linux shell storage fixture passed across six independent launches, covering persistent and HttpOnly cookies, expiry/deletion, localStorage, IndexedDB, closing/reopening the last tab, and switching profiles with live pages.
  • The direct WebKitGTK helper tests passed, including profile locking, concurrent independent profiles, invalid storage paths, and cookie file permissions.

Native macOS execution was not available in the Linux development environment; its validation is configured in CI. Windows continues to use the default external browser. This does not add password autofill or tab restoration, and websites can still expire or revoke sessions.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

jsgrrchg and others added 15 commits October 2, 2026 20:18
… cleanup

Require explicit storage results, validate deletion in every store, and preserve primary failures while attempting all profile cleanups. Add opt-in native cookie and same-process reopen diagnostics.

Validated on macOS 27 arm64: release check/build and native tests pass. Two complete storage runs correctly fail on cookies returning after process restart; all profile cleanups pass. Cookie deletion persistence remains unresolved.
@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added the review:needs-triage Managed by Contribution Manager label Oct 6, 2026
@contribution-manager-katulevskiy

contribution-manager-katulevskiy Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Contribution Manager

needs triage · medium risk · untriaged

Open review workspace · Revision ad7a7334

Next actions:

  • Direction decision needed
  • Scope, risk, and platform triage needed
  • Independent code review needed
  • Required check: core-tests (missing)

This summary is maintained by the review app. Decisions and test evidence are recorded in the workspace; the app does not merge PRs.

@contribution-manager-katulevskiy contribution-manager-katulevskiy Bot added cm:inbox Contribution Manager: waiting for triage and removed review:needs-triage Managed by Contribution Manager labels Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cm:inbox Contribution Manager: waiting for triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants