NEC-363: A second property set within 1.5 s on an open note is lost silently #328

Merged
cruelacid merged 1 commit from worktree-nec-363-bound-rewrite into main 2026-10-29 15:31:13 +00:00
Owner

Task: NEC-363

A property set on an open note 0.6 s after another was lost silently, in no file and no copy in either vault. The Markdown hardness run on the 0.6.0 candidate found it (seed 1339151073, round 65, on every replay).

Cause. A file change met while a note is bound in its editor is watched and merged in after 1.5 s (NEC-213), unless Obsidian rewrote the editor in the 1.5 s before. In that case the rewrite is taken as the reload that carried the change in. Any rewrite in the window counted, including one that had already carried in the previous change. Instrumented, the log showed no rewrite between the second change and the editor letting go.

Fix. A rewrite answers for one change only. It is used up by the first change read after it, whichever way that change is read, and a rewrite that carried a waiting change in is not remembered at all. The log now says when a change is taken as carried in by a rewrite.

Evidence

  • Two regression tests in content-sync-record.test.ts. Both fail on origin/main, and each fails when its own half of the fix is taken out. The existing tests against a double merge after a real reload still pass.
  • The seed replays past round 65 with the fix.
  • The local gate passes at 49104cfa, every step but e2e.

Still open (docs/sync-limitations.md, entry now "mitigated"): the rewrite signal cannot tell a reload from another pane mirrored in. Not seen.

The same seed then failed at round 245 for an unrelated reason, filed as NEC-364: a Kanban view writing over another tool's card while sync was stopped.

Changelog

A property set on a note that is open in an editor, for example by another plugin, is no longer lost when the editor does not take it in.

🤖 Generated with Claude Code

https://claude.ai/code/session_01P5JXvAgQ27c4dMFDB2Wu5B

Task: NEC-363 A property set on an open note 0.6 s after another was lost silently, in no file and no copy in either vault. The Markdown hardness run on the 0.6.0 candidate found it (seed 1339151073, round 65, on every replay). **Cause.** A file change met while a note is bound in its editor is watched and merged in after 1.5 s (NEC-213), unless Obsidian rewrote the editor in the 1.5 s before. In that case the rewrite is taken as the reload that carried the change in. Any rewrite in the window counted, including one that had already carried in the previous change. Instrumented, the log showed no rewrite between the second change and the editor letting go. **Fix.** A rewrite answers for one change only. It is used up by the first change read after it, whichever way that change is read, and a rewrite that carried a waiting change in is not remembered at all. The log now says when a change is taken as carried in by a rewrite. **Evidence** - Two regression tests in `content-sync-record.test.ts`. Both fail on `origin/main`, and each fails when its own half of the fix is taken out. The existing tests against a double merge after a real reload still pass. - The seed replays past round 65 with the fix. - The local gate passes at 49104cfa, every step but e2e. **Still open** (`docs/sync-limitations.md`, entry now "mitigated"): the rewrite signal cannot tell a reload from another pane mirrored in. Not seen. The same seed then failed at round 245 for an unrelated reason, filed as NEC-364: a Kanban view writing over another tool's card while sync was stopped. ## Changelog A property set on a note that is open in an editor, for example by another plugin, is no longer lost when the editor does not take it in. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01P5JXvAgQ27c4dMFDB2Wu5B
Let one rewrite of the bound editor answer for one file change only
All checks were successful
Release note / release-note (pull_request) Successful in 19s
CI / build (pull_request) Successful in 5m47s
CI / e2e (pull_request) Successful in 14m56s
CI / promote (pull_request) Has been skipped
CI / build (push) Successful in 6m15s
CI / e2e (push) Successful in 14m59s
CI / promote (push) Successful in 33s
49104cfaab
A file change met while a note's editor is bound, holding something the
document lacks, is watched and merged in after 1.5 s unless Obsidian
rewrote the editor less than 1.5 s before: that rewrite is taken as the
reload carrying it in (NEC-213). Any rewrite in the window counted,
including one that had already carried in the change before it.

The Markdown hardness run on the 0.6.0 candidate (seed 1339151073, round
65, on every replay) set two properties on an open note 0.6 s apart. A
rewrite carried the first in; the editor never took the second, and the
first's rewrite was read as its reload. The value was in no file and no
copy, in either vault. Instrumented, the log showed no rewrite between the
second change and the editor letting go.

A rewrite is now used up by the first change read after it, whichever way
that change is read, and one that carried a waiting change in is not
remembered at all. Each half has its own test, and each test fails with
its half taken out. The seed's round 65 settles with the fix. The log now
also says when a change is taken as carried in by a rewrite, which is the
line that would have explained this failure.

Still open, in sync-limitations.md: the rewrite signal cannot tell a
reload from another pane's edit mirrored in.

Task: NEC-363
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P5JXvAgQ27c4dMFDB2Wu5B
cruelacid referenced this pull request from a commit 2026-10-30 14:58:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda!328
No description provided.