Prevent stale browser tabs from overwriting saved projects - #52
Merged
Conversation
Collaborator
Author
|
Merged and verified live at https://app.openplan3d.com/ (merge commit 2e077a9).
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.