2 comments

  • arabinda 4 hours ago

    obsidian sync is genuinly one of those things people complain about constantly, interested to see how the conflict resolution works when edits happen on multiple devices simultaneously

    • kavinsood 4 hours ago

      Conflicts mathematically don't exist in YAOS because it uses Yjs (a CRDT) under the hood.

      This is not the traditional 'last-write-wins' conflict resolution (where it detects a collision and asks you to pick a winner).

      If two devices are editing the same note simultaneously, keystrokes are broadcasted over WebSockets to a Cloudflare Durable Object, Yjs merges the edits concurrently. You will see the remote cursors flying around.

      Even if the devices are offline, the edits are saved locally to IndexedDB. When devices reconnect, they compute a state vector difference, exchange the missing binary deltas, and deterministically converge on the exact same text. No conflict files are ever generated.

      I wasn't looking to make this into a paid service, rather a OSS plugin. The important thing for me was that self-hosting this shouldn't involve docker, VMs, etc. The DX with Cloudflare is pretty nice.