Let a write wait for a file change being read in, so one race keeps one copy #330
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
dependencies
e2ee-constrained
gate:at-ga
gate:pre-ga
marketing
parity
relay:absent
relay:planned
relay:requested
relay:supported
risk:additive
risk:contract
risk:none
security
usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Nectenda/nectenda!330
Loading…
Reference in a new issue
No description provided.
Delete branch "worktree-nec-365-one-copy"
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?
Stacked on #329 (its first four commits are that PR's). The commit to review is the last one.
Found by the Markdown hardness run, seed 2043722577, round 341. One raced save kept two backup copies instead of one. A debounced disk write read the file while a modify event for the same file was still being read in, saw content it didn't expect, and kept a copy of it. The read-in then kept its own copy of the same content.
ContentSyncnow tracks the read-ins in flight per document. A write that meets one waits for it to settle, then reschedules, so one race keeps one copy. Nothing is discarded: the write still runs, against the content the read-in left.content-sync-record.test.tsadds "keeps one copy of a raced save, not a second from the write that met it while it was read in (NEC-365)". With the wait disabled it fails with 2 copies.docs/sync-limitations.md: a paragraph added to the NEC-280 entry.build-mirror --checkare green. The fresh Markdown hour, seed 350133408, ran on this branch: 354 rounds settled, passed. Its container build was grepped for the fix.The changelog is NONE because the raced keep that made the second copy has never been in a released version.
Task: NEC-365
Changelog
NONE
🤖 Generated with Claude Code
https://claude.ai/code/session_01P5JXvAgQ27c4dMFDB2Wu5B