NEC-294: An offline edit read in from an open drawing is lost when sync restarts at that moment #299
No reviewers
Labels
No labels
area:docs
area:identity
area:ops
area:plugin
area:server
channel:community
channel:direct
channel:owned
channel:press
channel:social
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda!299
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-nec-294-an-offline-edit-read-in-from-an-open-dra"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task: NEC-294 — https://projectron.nerchure.com/tasks/307
Stopping sync tore a structured document down without waiting for a write in flight. A drawing's first write after reconnecting, parked on its read of the file, carried on into the torn-down document: it took a version only an open view held from the DeleteWitness every sync shares (which hands each version out once), so the restarted sync never read it in, and the edit was lost in both vaults with no copy (Excalidraw hardness seed 263552908). It also stored what it agreed on with the file, which would have let the next connect write over an offline edit had the closing database not refused it. StructuredSync now checks after every await in writeToDiskOnce, onLocalModify and the take-over from text that its document is still synced, and stops there, leaving the file, its record and what views held to the next connect. Tests first: 6 new tests failed on main for the stated reasons (2 controls passed) before the fix; each guard is mutation-checked (spec: docs/changes/NEC-294-stopped-sync-takes-view-edit/spec.md). SAFE-A31 amended; sync-limitations entry added.
Spec:
docs/changes/NEC-294-stopped-sync-takes-view-edit/spec.mdChangelog
Fixed an unsaved drawing edit being lost when sync was stopped and started again just as it reconnected.