Skip to content

Prevent stale browser tabs from overwriting saved projects - #52

Merged
theLodgeBots merged 1 commit into
mainfrom
codex/local-save-conflicts
Sep 6, 2026
Merged

Prevent stale browser tabs from overwriting saved projects#52
theLodgeBots merged 1 commit into
mainfrom
codex/local-save-conflicts

Conversation

@theLodgeBots

@theLodgeBots theLodgeBots commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

An older editor tab could silently overwrite newer saved edits or recreate a deleted project. Compare the project revision before writes, coordinate current tabs under a shared browser lock, and surface conflicts without replacing local work. Save as copy preserves the tab's version under a fresh ID; failures and edits made while copying retain the current plan.

Library deletion checks its listed revision; unrelated projects remain independent; queued saves freeze their data before waiting; old thumbnail writes are rejected. Library action buttons gain accessible labels and remain visible on touch screens. Existing local files and iPhone formats are unchanged, with no Firebase Storage traffic or new hosted services.

Validation: 390 unit tests, zero type errors, 23 existing warnings, and a passing production build. Five new browser workflows cover real two-tab desktop/mobile conflicts, backup/copy recovery, quota failure, deletion, concurrent different-project writes, and editing during a held Web Lock. All 30 browser tests passed in PR CI. Interactive production-build checks passed for stale-tab Save refusal, recovery copies, original/copy reload, a retained 44.25 cm mobile edit, 3D, and preventing recreation after library deletion, with no browser errors. Post-merge live verification is recorded below.

Web Locks coordination requires a supported secure context and current app tabs. Older app tabs do not participate; refresh them before concurrent editing. Unsupported/insecure contexts retain revision checks without simultaneous-write coordination. This does not implement automatic merging or cloud synchronization.

Closes #51.

@theLodgeBots
theLodgeBots merged commit 2e077a9 into main Sep 6, 2026
1 check passed
@theLodgeBots
theLodgeBots deleted the codex/local-save-conflicts branch September 6, 2026 20:46
@theLodgeBots

Copy link
Copy Markdown
Collaborator Author

Merged and verified live at https://app.openplan3d.com/ (merge commit 2e077a9).

  • Final PR CI: https://github.com/laanlabs/openPlan3D/actions/runs/34058737003 — 390 unit tests and all 30 browser tests passed.
  • Post-merge CI: https://github.com/laanlabs/openPlan3D/actions/runs/34059018938 — 390 unit tests and all 30 browser tests passed. Audit found zero vulnerabilities; Svelte check has zero errors and 23 existing warnings; production build passed.
  • Interactive local production-build checks verified conflict notifications, stale-tab Save refusal, original/copy reload, a 44.25 cm mobile wall edit, 3D, visible touch library actions and prevention of project recreation after deletion. Browser logs were clear.
  • Live checks used two freshly loaded tabs and the disposable QA Save Conflicts fixture. One tab saved QA Live Saved Version. The older tab retained its own work and showed a conflict; Save did not overwrite the stored version. Save as copy created QA Live Alternative (Recovered copy). Both versions reloaded independently. The recovered copy retained a 46.75 cm wall edit and rendered in 3D at 390 px with no browser errors.
  • Issue Prevent older browser tabs from overwriting newer project edits #51 is closed. All work is committed on main; the feature branch is deleted locally and remotely. Web and iPhone working trees are clean. The local test server and extra test tabs are closed.

No Firebase Storage operations, live storage rules, hosted endpoints or iPhone formats changed. Refresh older app tabs before editing a shared local project concurrently: old builds do not participate in the new revision checks or lock. Browsers without Web Locks retain revision checks without simultaneous-write coordination. Remaining cloud/client-distribution and billing work is still tracked in #30.

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.

Prevent older browser tabs from overwriting newer project edits

1 participant