Mentions: no waiting; search pushes caught_up, head read from an atomic (#414) #424

Closed
kayg wants to merge 0 commits from issue/414-mentions-live-2 into dev
Owner

Closes #414. Replaces #423 (same design; behind no longer opens a subscription per call).

Cause: plain mentions come from search, which follows the journal a moment behind. Info asked notes.backlinks once and only re-asked when a note changed, so a stale answer stayed. Fails 1 in 6 on dev and train k.

Fix, no waiting and no polling:

  • Journal::head(user) hands out the store's own Arc<AtomicI64> head (already updated on every append). The indexer stores it in Status once; MentionFinder::behind is then two atomic reads: head vs Status.done (newest entry the index has taken in). Covers the window before the indexer has received an entry.
  • notes.backlinks sets incomplete when behind.
  • When behind, Status.want remembers the seq; the indexer records search.caught_up {seq} once (via EventRecorder) over the existing live socket. Nothing is recorded if nobody asked.
  • Web: applyEntry bumps notesState.indexed; the Info sheet re-asks once.

Checked: test behind_answers_at_once_and_catching_up_is_announced_once; workspace clippy clean; core, search, notes, store, engine, calternal tests pass; svelte-check no errors; links.spec --repeat-each 6 chromium-1440 6/6 (12/12 on chromium and webkit-1440 on the previous revision).

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #414. Replaces #423 (same design; `behind` no longer opens a subscription per call). Cause: plain mentions come from search, which follows the journal a moment behind. Info asked `notes.backlinks` once and only re-asked when a note changed, so a stale answer stayed. Fails 1 in 6 on dev and train k. Fix, no waiting and no polling: - `Journal::head(user)` hands out the store's own `Arc<AtomicI64>` head (already updated on every append). The indexer stores it in `Status` once; `MentionFinder::behind` is then two atomic reads: head vs `Status.done` (newest entry the index has taken in). Covers the window before the indexer has received an entry. - `notes.backlinks` sets `incomplete` when behind. - When behind, `Status.want` remembers the seq; the indexer records `search.caught_up {seq}` once (via `EventRecorder`) over the existing live socket. Nothing is recorded if nobody asked. - Web: `applyEntry` bumps `notesState.indexed`; the Info sheet re-asks once. Checked: test `behind_answers_at_once_and_catching_up_is_announced_once`; workspace clippy clean; core, search, notes, store, engine, calternal tests pass; svelte-check no errors; links.spec `--repeat-each 6` chromium-1440 6/6 (12/12 on chromium and webkit-1440 on the previous revision). 🤖 Generated with [Claude Code](https://claude.ai/code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Mentions: say when search is behind, and push search.caught_up when it is not (#414)
Some checks failed
CI / server (pull_request) Successful in 31s
CI / rust (pull_request) Successful in 2m15s
CI / web (pull_request) Failing after 40m25s
3a57a9873f
notes.backlinks no longer waits: it compares the journal head with the
newest entry the index has taken in (two reads) and sets incomplete when
behind. The indexer records search.caught_up {seq} once it reaches that
entry, over the existing live socket, and the Info sheet re-asks once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Mentions: read the journal head from a plain atomic (#414)
Some checks failed
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Successful in 2m0s
CI / web (pull_request) Failing after 43m49s
eda6c25f86
The store already keeps its head in an AtomicI64 updated on every append.
Journal::head now hands that out once; behind() reads it, with no
subscription per call.

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

Landed in dev via train k (#441).

Landed in dev via train k (#441).
kayg closed this pull request 2026-10-15 14:34:36 +00:00
Some checks failed
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Successful in 2m0s
CI / web (pull_request) Failing after 43m49s

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