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

Closed
kayg wants to merge 1 commit from issue/289-crash-typing-race 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

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
Test: notes_crash_typing saves before reading the text it checks (#289)
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 23s
CI / rust (pull_request) Successful in 1m35s
01cdf582fd
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

Test-only fix. The agent's evidence on #289: 17 of 17 instrumented failures were the test's snapshot taken before the first save, with no outside or swap-back updates in history.db, and 100 of 100 runs pass after the fix. Rebased onto current dev (the old branch predated train b).

Test-only fix. The agent's evidence on #289: 17 of 17 instrumented failures were the test's snapshot taken before the first save, with no outside or swap-back updates in history.db, and 100 of 100 runs pass after the fix. Rebased onto current dev (the old branch predated train b).
kayg closed this pull request 2026-10-14 14:40:27 +00:00
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 23s
CI / rust (pull_request) Successful in 1m35s

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!295
No description provided.