Mentions: no waiting; search pushes caught_up when it catches up (#414) #423

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

Closes #414. Replaces #420 (which waited up to 2 s and polled).

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 (trace: one request). Fails 1 in 6 on dev and train k.

Fix, no waiting and no polling:

  • MentionFinder::behind(user): compares the journal head (Journal::head) with Status.done, the newest entry the index has taken in. Two reads, never waits. Because it compares seqs, it also 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 per wait) via the EventRecorder, over the existing live socket. Nothing is recorded if nobody asked.
  • Web: applyEntry bumps notesState.indexed; the Info sheet's effect depends on it and re-asks once.

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

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #414. Replaces #420 (which waited up to 2 s and polled). 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 (trace: one request). Fails 1 in 6 on dev and train k. Fix, no waiting and no polling: - `MentionFinder::behind(user)`: compares the journal head (`Journal::head`) with `Status.done`, the newest entry the index has taken in. Two reads, never waits. Because it compares seqs, it also 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 per wait) via the `EventRecorder`, over the existing live socket. Nothing is recorded if nobody asked. - Web: `applyEntry` bumps `notesState.indexed`; the Info sheet's effect depends on it and re-asks once. Checked: new test `behind_answers_at_once_and_catching_up_is_announced_once`; clippy (workspace) clean; core, search, notes and calternal tests pass; svelte-check no errors; links.spec `--repeat-each 12` passes 12/12 on chromium-1440 and 12/12 on webkit-1440. 🤖 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
Author
Owner

Superseded by #424: same design, behind reads the journal head from an atomic.

Superseded by #424: same design, `behind` reads the journal head from an atomic.
kayg closed this pull request 2026-10-15 08:43:08 +00:00
Some checks failed
CI / server (pull_request) Successful in 31s
CI / rust (pull_request) Successful in 2m15s
CI / web (pull_request) Failing after 40m25s

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