Train AJ: the server announces a note change only after the list has it; safe placement everywhere #633

Closed
kayg wants to merge 0 commits from train/2026-10-19aj into dev
Owner

Train AJ ran the full suite: fmt, clippy, workspace tests, the build, svelte-check, and every Playwright project in parallel shards.

Failures, each checked:

  • swipe-rows:274 (webkit-390): 7 of 8 alone; the one failure was a WebKit page crash (Target crashed), the known Playwright-WebKit host crash, not an assertion.
  • The Pin and deleted-note flakes (swipe-rows 141/207/227) passed in the full run for the first time: the server now commits the list before it announces a change.

Contents:

  • #587: note saves are written durably, then the list is committed, then the change event goes out (events are at-least-once hints; failures reconcile; startup recovers by scan). Every way a note file is placed refuses to overwrite (create, save, rename, move, Trash, restore, conflict copies, migration, case-only renames); a rename claims its destination before editing the title; a broken deletion history retries 3 times then shows a health error while the library stays usable; same-id creates settle idempotently. No change to the note file format (a stray title: was removed). Reviewed independently three times; 310 notes tests.
  • #591: the swipe list keeps a local pin/delete for 15 s and the test waits for rows to settle.

Replaces #629, #632 and #591.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5oTUycqAh7DT72mdSUztk

Train AJ ran the full suite: fmt, clippy, workspace tests, the build, svelte-check, and every Playwright project in parallel shards. Failures, each checked: - `swipe-rows:274` (webkit-390): 7 of 8 alone; the one failure was a WebKit page crash (`Target crashed`), the known Playwright-WebKit host crash, not an assertion. - The Pin and deleted-note flakes (swipe-rows 141/207/227) passed in the full run for the first time: the server now commits the list before it announces a change. Contents: - #587: note saves are written durably, then the list is committed, then the change event goes out (events are at-least-once hints; failures reconcile; startup recovers by scan). Every way a note file is placed refuses to overwrite (create, save, rename, move, Trash, restore, conflict copies, migration, case-only renames); a rename claims its destination before editing the title; a broken deletion history retries 3 times then shows a health error while the library stays usable; same-id creates settle idempotently. No change to the note file format (a stray `title:` was removed). Reviewed independently three times; 310 notes tests. - #591: the swipe list keeps a local pin/delete for 15 s and the test waits for rows to settle. Replaces #629, #632 and #591. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01U5oTUycqAh7DT72mdSUztk
kayg added 20 commits 2026-10-19 17:59:50 +00:00
The server writes its note list a moment after it announces a change. The app re-reads the list
a quarter of a second after every event, and under load that read can still show the note as it
was: a note just pinned came back unpinned (and the next tap on "Unpin" pinned it again), and a
note just deleted came back as a row. Neither was ever corrected, as no later event follows.

- A pin this device asked for wins over a list read until the list agrees or 15 s pass.
- A deletion wins over a list read for 15 s, not only over reads that began before it (a
  notes.created for it, an undo or a restore, still lets it back at once).
- swipe-rows.spec: two tests that make every list read stale (they fail without the fix); the
  rows are measured and touched in one go and the test waits until every row has its final text
  and nothing slides (the second list sorts the two notes the other way, and the rows pass over
  each other, so a swipe could land on the other note); Undo is tapped once the toast is open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5oTUycqAh7DT72mdSUztk
swipe-rows.spec: a list read still going when the test ends is let go (#587)
Some checks failed
CI / server (pull_request) Successful in 28s
CI / web (pull_request) Failing after 43s
CI / rust (pull_request) Successful in 4m16s
d5ac53882d
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U5oTUycqAh7DT72mdSUztk
Reconcile note lists from durable writes before publishing hints
Some checks failed
CI / server (pull_request) Successful in 23s
CI / web (pull_request) Failing after 32s
CI / rust (pull_request) Successful in 4m22s
e174661153
Place absent files exclusively so an outside create survives the placement
window and is returned as a conflict. Propagate deletion-history failures
through discovery so startup remains incomplete until its retry succeeds.
Key lifecycle diagnostics by note identity so independent sibling futures
can wait safely in one Tokio task.

Skip backlink parsing without an opening bracket and stop tag scanning
after the last hash's line. This removes unnecessary full-text parsing
from synchronous list publication. Add permanent regression tests for the
three review findings and both scan failure stages.

Refs: #587
Preserve note placements and bound failed discovery
Some checks failed
CI / server (pull_request) Successful in 32s
CI / web (pull_request) Failing after 48s
CI / rust (pull_request) Failing after 1m56s
5b4e4ea47b
Use exclusive note moves and guarded writes through create, bulk jobs,
Trash, restore and migration. Keep stored destinations fixed until their
dependent edits can run, and preserve the original create version on replay.

Bound startup retries and retain an actionable failed-scan health state
while known notes remain usable. Serialize independent same-id create
futures without mistaking their shared Tokio task for recursive entry.

Refs: #587
Base-commit: 80e94699a6
Claim rename destinations before editing note titles
Some checks failed
CI / server (pull_request) Successful in 27s
CI / web (pull_request) Failing after 38s
CI / rust (pull_request) Successful in 5m20s
0104c0fe1d
Keep the original title and path unchanged when a planned destination becomes occupied. Preserve the placement conflict code through bulk jobs. Replay exclusive moves before title edits and retain destination-first undo ordering.

Port the public API collision regression and cover restart after conflict, real process death at both move/title boundaries, and undo title preservation.

Refs: #587
Base-commit: 5b4e4ea47b
Keep initial note frontmatter in its existing format
Some checks failed
CI / server (pull_request) Successful in 32s
CI / web (pull_request) Failing after 44s
CI / rust (pull_request) Failing after 5m16s
0a66200147
Write only calternal-id and timestamps when placing initial text. Compare retry content without treating title as a generated server field, preserving authored properties and rejecting different content.

Cover exact file bytes for plain text and H1 bodies, unchanged retries after reopening, and conflicting body or title changes. Make the title-property visibility test perform a real property edit without relying on a generated title.

Refs: #587
Base-commit: 0104c0fe1d
Merge remote-tracking branch 'origin/issue/400-swipe-flake' into train/2026-10-19aj
Some checks failed
CI / server (pull_request) Successful in 33s
CI / web (pull_request) Failing after 48s
CI / rust (pull_request) Successful in 4m59s
e7dba5e148
Author
Owner

This PR's commits are on dev (landed). Forgejo kept it open and its merge endpoint answers 405, so it is closed by hand.

This PR's commits are on dev (landed). Forgejo kept it open and its merge endpoint answers 405, so it is closed by hand.
kayg closed this pull request 2026-10-21 11:32:34 +00:00
Some checks failed
CI / server (pull_request) Successful in 33s
CI / web (pull_request) Failing after 48s
CI / rust (pull_request) Successful in 4m59s

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