Skip to content

fix: stop the app's own overlapping saves from showing a false conflict [20261121-stop-app-s-own-overlapping-saves] - #104

Merged
ttncode merged 2 commits into
mainfrom
fix/20261121-stop-app-s-own-overlapping-saves
Nov 21, 2026
Merged

ttncode merged 2 commits into
mainfrom
fix/20261121-stop-app-s-own-overlapping-saves

Conversation

@ttncode

@ttncode ttncode commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Topic: 20261121-stop-app-s-own-overlapping-saves

Change summary

  • The app recognised its own change events by the last version it wrote per note (written in app.js). When saves of one note overlapped (e.g. holding Alt+Down), the older save's event came back after the newer save had started, didn't match, and was merged as another window's edit: a false "This note was also edited in another window" message, and with text edits a duplicated paragraph.
  • extension/merge.js: new createOwnSaves() holds every version still being saved and releases each when its save settles.
  • extension/app.js: persist tracks before saving and releases in .finally; acceptRemote asks ownSaves.isOwn(remote). The cross-window merge stays, for a possible second window later.
  • tests/merge.test.js: 3 tests, one against the real file area and store with overlapping delayed saves and a failed save.

Verify

step command result
unit node --test "tests/*.test.js" exit 0 · 217/217 pass · Node 22.17.1
regression isOwn reduced to the latest version 2 tests fail; restored → pass

Verified: green, and the run describes the tree as it is now.

Note: npm test on main is still the old form until #103 merges.

Ship decision: GO

No Critical or Important finding. 8 readers, 0 fix-now.

Things I didn't touch

  • The integration test uses its own copy of persist; app.js can't be imported in Node. Moving the save sequence into one helper is deferred.
  • The fix relies on the file area firing a change event before its save settles (it does, and the test pins it). A future storage area that fires later would need another look.
  • Note positions running out of room (audit item 3) and the duplicate Sprints note on import (item 4).

Release

20261121-stop-app-s-own-overlapping-saves — no false conflict from the app's own saves

Change

  • Fixed: moving or editing a note quickly no longer shows "This note was also edited in another window", and no longer duplicates a paragraph, when no other window exists.

Before release

  • The change carries no migration and reads no new configuration value. (checked)
  • kiln verify ran the full unit suite: exit 0, 217 of 217 pass on Node 22.17.1. (checked)
  • The regression test fails with the fix undone (2 fail) and passes with it. (checked)
  • In the desktop app, holding Alt+Down on a note in the list shows no conflict message. (confirm)

Release steps

  1. Merge the pull request once CI is green.
  2. Ship it in the next release as usual.

After release

  • After updating, fast note moves and edits show no "edited in another window" message. (confirm)

Rollback

  • Trigger: notes edited in Notelet stop saving, or the conflict message appears more often than before.
  • Steps: git revert the merge commit, then open and merge that pull request, then release.
  • Time: one revert pull request and one release.

The app recognised its own change events by the last version it wrote per
note. When an older save finished after a newer one had started, its event
no longer matched and was merged as another window's edit: a false "edited
in another window" message, and with text edits a duplicated paragraph.

Track every version still being saved and release each when its save
settles; any in-flight version's event is this window's own.
This was referenced Nov 21, 2026
@ttncode
ttncode merged commit 0f5c1fb into main Nov 21, 2026
1 check passed
@ttncode
ttncode deleted the fix/20261121-stop-app-s-own-overlapping-saves branch November 21, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant