Test: notes_crash_typing saves before reading the text it checks (#289) #296

Closed
kayg wants to merge 0 commits from issue/289-test-race-2 into dev
Owner

Fixes #289.

This is a test race; the save behaves correctly. In the runs that failed, the tabs typed without pausing for the save delay, so the note was never saved during the session. The test read text and then saved, and that first save stamped calternal-id, date, last edited and title. The file then held the stamped note, while the test compared it with the unstamped text. The same race sometimes shows up as "c never converged".

Evidence (details on the issue):

  • In all 17 failures, the file equalled the note read after the save, and that note minus its frontmatter equalled text.
  • I copied the data folder of 3 failing runs before the final save. History.db shows only user updates plus the 4 server stamp updates, and no outside updates. So #264's swap-back and retry path never ran.

Change: the test saves before it reads text. Nothing else changes.

Result: before, about 1 run in 5 failed in a loop under load (6/40, 11/40, 3/12, 3/8). After, 100 of 100 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

(Replaces #295, merged with current dev. Review on #295.)

Fixes #289. This is a test race; the save behaves correctly. In the runs that failed, the tabs typed without pausing for the save delay, so the note was never saved during the session. The test read `text` and then saved, and that first save stamped `calternal-id`, `date`, `last edited` and `title`. The file then held the stamped note, while the test compared it with the unstamped `text`. The same race sometimes shows up as "`c` never converged". **Evidence** (details on the issue): - In all 17 failures, the file equalled the note read *after* the save, and that note minus its frontmatter equalled `text`. - I copied the data folder of 3 failing runs before the final save. History.db shows only user updates plus the 4 `server` stamp updates, and no `outside` updates. So #264's swap-back and retry path never ran. **Change:** the test saves before it reads `text`. Nothing else changes. **Result:** before, about 1 run in 5 failed in a loop under load (6/40, 11/40, 3/12, 3/8). After, 100 of 100 pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T (Replaces #295, merged with current dev. Review on #295.)
Test: notes_crash_typing saves before reading the text it checks (#289)
Some checks failed
CI / web (pull_request) Failing after 27s
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Failing after 1m39s
d5cf8fcb3d
The note may never have been saved while the tabs typed without pause,
and its first save stamps the server's frontmatter keys. Read before
that save, the text changed under the file check and the tab rejoin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Closing: this branch is already fully contained in dev (it landed through a merge train). Branch cleanup, 2026-10-15.

Closing: this branch is already fully contained in `dev` (it landed through a merge train). Branch cleanup, 2026-10-15.
kayg closed this pull request 2026-10-15 08:34:28 +00:00
Some checks failed
CI / web (pull_request) Failing after 27s
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Failing after 1m39s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!296
No description provided.