Skip to content

v0.18.2

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 18:22
· 1 commit to main since this release

Fixes

An edit through zn never writes over a save another device just made. Against a self-hosted server, zn's edits read a note, change it and write it back. A save from another device landing in between used to be written over. With a server that supports conditional writes (ZenNotes server 2.91.0 or later), zn now names the version it read on every write, and the server refuses the write if the note changed:

  • CLI and MCP edits (append, prepend, insert, replace, edit a section, toggle or update a task, and a database row's record page) read the note again and make the same change on the newer text. After three refusals they stop and say the note changed on the server, so nothing is lost.
  • TUI saves (autosave and :w) that race another device's save show the usual conflict: your buffer is kept and autosave holds off. :conflict has a new Keep both (b): the server's version is kept as "Title (server copy)", then your edits are saved.

zn write and write_note still replace the note as asked. A local vault, and a server older than 2.91.0, behave exactly as before. Same protection as ZenNotes desktop 2.91.0 (ZenNotes/zennotes#1108).

How to test locally

  1. Run a ZenNotes server 2.91.0 and connect: zn connect http://127.0.0.1:7878 --token <token>.
  2. Open a note in zn tui, change it on another device, then save in the TUI. Before: the other device's change was gone. After: the TUI shows a conflict; :conflict then b keeps both.
  3. zn append "inbox/Note.md" --body "from zn" while another device keeps saving the note: both changes end up in the file.