Repository navigation
Sync: ink survives file changes, saves wait for a rest, read per-page notebooks (#273, #274) - #286
Merged
Merged
Conversation
Every save rewrites the whole notebook, and Obsidian Sync keeps each write as a version for a month. A save now waits until the pen has rested 5 s (was 1 s) and at most 60 s (was 20 s): about 56 saves an hour of writing instead of about 246. PDF rasterising and the background save worker keep the 1 s quiet; a pen held down 20 s still counts as a lost lift. Leaving the app, closing the notebook and unloading still save at once. A save Obsidian asks for after the pen's quiet timer has run now gets a timer of its own, so it is not left waiting for the next stroke. Refs #274 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since 2.10.0 the notebook view is not plain text to Obsidian (#246), so a modify event while the view had unsaved ink replaced the notebook with the file: the newest strokes vanished and, with the history cleared, undo could not bring them back. Obsidian's loadFileInternal also reads lastSavedData only after its awaited read, so a save starting meanwhile made the view's own previous save look like a change from elsewhere. A reread of a text this view loaded or wrote is now skipped (history kept), and a real change from elsewhere is merged three ways, by id, with the unsaved ink (src/model/reload-merge.ts). The diagnostics export and the debug HUD count what happened (diskReloads). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A copy of the notebook arriving late from another device made ink this device had already saved look erased over there, and the merge dropped it. It also did so with nothing unsaved here, and for a page with no unsaved changes, which was taken whole from the file. - Anything this device has that the file lacks is kept, saved or not, and saved back. Price: an erase made on another device while this one holds the notebook open comes back. - Pages are looked inside even when unchanged here, and a list the file stores as absent (no pictures) counts as empty, not as removed. - Two devices that counted on from the same highest id gave different new strokes one id; the merge kept only this device's. Both are kept now, the other renumbered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layout (c3) of the sync research: Pages/<notebookId>/<pageId>.<deviceId>.md plus _meta.<deviceId>.md, the notebook id in frontmatter (finenotes-id), the old payload kept in the notebook file as the legacy source (v2+device-pages). - provenance.ts: device-dotted ids, version vectors, which version wins. - device-pages-union.ts: union by id, tombstones that saw the version they erase, last-writer-wins registers (Lamport clock, device id tie) for settings and page entries, fractional order keys, stale/missing pages from rev + hash. Absence is never deletion. - device-pages.ts: names, safe paths, blocks, FNV-1a 64 hash, readers. - The plain decoder refuses a device-pages payload, so nothing saves it. Reuses PR #282's decoder refusal, block files and Home stat; names, meta and union are new. Read-only: nothing here writes the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The view shows such a notebook joined from its page folder, holds it read-only (the load guard echoes the file), and reads it again when one of its files syncs in. One notice: read-only, or some pages still syncing. Home counts the page files in a notebook's stamp and reads its pages and text from them. Nothing writes the layout yet: that is the next release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An embed of such a notebook shows its pages joined from its page folder, and reads it again when one of the folder's files changes, even when the newest change stays the same (a page file gone). The vault helpers Home used move to view/device-pages-files.ts, shared by both. Read-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/view/ink-view.ts
…tion # Conflicts: # src/view/ink-view.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in the real-Obsidian rig: a copy over the file empties it, then fills it. Obsidian read the empty file in between, and the view took it for a blank notebook (the load guard only holds an empty read when the file's size is above zero, and here it was already 0). The read of the filled file then had no base to merge against, so ink this device had saved was replaced. An empty read is now skipped, and nothing is saved on it, so the incoming copy is not written over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings together three sync fixes, tested together in the real-Obsidian rig. Supersedes #279, #278 and #282.
Refs #273 #274
Ink survives the file changing on disk (#273, from #279)
Saves wait for a 5 s rest (#274, from #278)
Read notebooks kept as one file per page per device, read-only (#274, the reader for the next release's writer)
Pages/<notebookId>/<pageId>.<deviceId>.mdplus per-device meta files, version vectors and per-element change stamps. Nothing writes this layout yet; this release only reads it, so devices a release behind can open what the writer will make.Also
format:checkpasses again.Tested
typecheck,lint,lint:review,lint:css,format:check,test(9869 passed, 7 skipped),build.🤖 Generated with Claude Code