Skip to content

fix: prevent browser workspace data loss - #16

Merged
Yuki9814 merged 1 commit into
mainfrom
agent/storage-recovery
Jul 28, 2026
Merged

fix: prevent browser workspace data loss#16
Yuki9814 merged 1 commit into
mainfrom
agent/storage-recovery

Conversation

@Yuki9814

Copy link
Copy Markdown
Owner

Summary

  • isolate corrupt and future-schema browser payloads without rendering or automatic overwrite
  • classify missing, migrated, quota, unavailable, and cross-tab conflict states with accessible recovery actions
  • preserve exact raw storage strings for lossless recovery and compare-before-write/remove checks
  • keep failed tabs usable in memory with current-workspace backup, manual retry, and explicit reload/discard paths
  • migrate historical schema v1–v7 workspaces safely to schema v8 without changing the storage key

User impact

PatchHive now fails visibly instead of silently replacing unreadable, newer, full, denied, or externally changed browser storage. A second tab that writes a newer or corrupt payload locks the first tab before normal save/import/reset; the first tab can back up its in-memory work and reload the stored value.

Web Storage has no atomic compare-and-swap operation. The exact re-read plus storage-event lock narrows the race window but does not claim strong multi-writer consistency.

Validation

  • 106 unit and component tests passed
  • 12 Chromium E2E tests passed, including real second-tab future-schema and corrupt-payload scenarios
  • lint, TypeScript build, GitHub Pages path verification, dependency tree, and diff checks passed
  • npm audit: 0 vulnerabilities
  • 6 scanner benchmark scenarios passed on Apple M5 arm64; 250-finding p95 preview 36.68 ms JSON and 52.21 ms SARIF, with p95 heap 20.82 MiB and 21.33 MiB
  • rendered desktop and 390x844 mobile checks: correct page identity, no blank/error overlay, no horizontal overflow, no console warnings/errors, and visible conflict lock actions
  • two independent final reviews: no findings

Evidence status

Part of #13.

External usability evidence remains N=0 trials. This PR does not close the evidence issue or claim external adoption.

@Yuki9814
Yuki9814 marked this pull request as ready for review July 28, 2026 13:39
@Yuki9814
Yuki9814 merged commit 7b16c06 into main Jul 28, 2026
2 checks passed
@Yuki9814
Yuki9814 deleted the agent/storage-recovery branch July 28, 2026 13:39
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.

1 participant