Skip to content

[Bug] Startup reconcile writes a '- disk' conflict artifact for a fresh note that's open and being typed in (2.1.1) #77

Description

@Mokson

YAOS plugin version

2.1.1

Server deployment commit SHA

Don't have it handy, the worker hasn't been redeployed since I moved the client to 2.1.1.

Relevant logs or error text

No flight log, debug was off. What I have is the artifact and timestamps (all local time, UTC+1):

12:36:45  Obsidian relaunched (I had just disabled a few community plugins)
12:39:44  YAOS wrote "note (YAOS conflict - disk from laptop 2026-09-09T11-39-44Z).md"
12:40:00  the note last modified (me typing)
12:42:55  _lastDiskIndexPersistedAt

The - disk artifact is byte identical to the note itself (92 bytes, one bullet). _diskIndex had an entry for the note but no contentHash, the note was created earlier the same day.

What you did

Made a new note, kept it open and kept typing. Restarted Obsidian with the note still open in a tab. About 3 minutes later a - disk conflict file showed up next to it, while I was still typing in the note.

Reading closedFileConflict.ts, that's the missing-baseline branch: no baseline hash for a fresh note, diskMtime wasn't newer than _lastDiskIndexPersistedAt (the global timestamp gets bumped by every other file save, so that check is pretty much always false for a note I'm actively editing), so CRDT wins and the disk copy goes to an artifact. Two things look off:

  • The closed-file path ran on a note that was open in the editor. I'd expect isOpenOrBound to defer it, but startup reconciliation seems to run before the editor binding exists.
  • With no baseline, a note that's being typed into on this device should win, or at least the decision should wait until the editor is bound. Defaulting to CRDT and dumping the local copy as a conflict file is the wrong side when the only writer is me, on this device.

Nothing was actually lost this time because my edits kept flowing into the CRDT after the swap, but the artifact makes it look like it was. Locally I've patched the missing-baseline branch to disk-wins with the CRDT side preserved, which is the same shape as the both-changed branch. Happy to turn debug on and attach a trace if you want one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions