Info: plain mentions can stay missing when search lags a fresh note #414

Closed
opened 2026-10-15 07:16:20 +00:00 by kayg · 1 comment
Owner

Seen as a flake in links.spec.ts:57 ("Info shows the notes linking here and plain mentions; Link turns a mention into a link"): the Mentions region never shows the plain-mention note within 15 s, while the note that links to the target does show. It fails 1 in 6 on plain dev with --repeat-each 6 on chromium-1440, and about 2 in 7 on train 2026-10-15k, so it is not a train regression.

Cause: plain mentions come from search, and search follows the journal a moment behind (quiet period, then a batch). Info asks notes.backlinks once when it opens. If the index has not yet taken in a note that was just written, that answer lacks it. The page only asks again when some note changes (notesState.rev), and in a quiet session nothing does, so the list stays stale. The server already returns incomplete, but the web ignores it. Trace of a failing run: exactly one notes.backlinks request.

Fix: notes.backlinks waits (up to 2 s) for the search index to be idle before asking for mentions, and sets incomplete if it is still behind. Info asks again each second while incomplete (capped).

Seen as a flake in `links.spec.ts:57` ("Info shows the notes linking here and plain mentions; Link turns a mention into a link"): the Mentions region never shows the plain-mention note within 15 s, while the note that links to the target does show. It fails 1 in 6 on plain `dev` with `--repeat-each 6` on chromium-1440, and about 2 in 7 on train 2026-10-15k, so it is not a train regression. Cause: plain mentions come from search, and search follows the journal a moment behind (quiet period, then a batch). Info asks `notes.backlinks` once when it opens. If the index has not yet taken in a note that was just written, that answer lacks it. The page only asks again when some note changes (`notesState.rev`), and in a quiet session nothing does, so the list stays stale. The server already returns `incomplete`, but the web ignores it. Trace of a failing run: exactly one `notes.backlinks` request. Fix: `notes.backlinks` waits (up to 2 s) for the search index to be idle before asking for mentions, and sets `incomplete` if it is still behind. Info asks again each second while `incomplete` (capped).
Author
Owner

Closing during the 26 Oct handover cleanup: The fix landed in dev (PRs #423, #424).

Closing during the 26 Oct handover cleanup: The fix landed in dev (PRs #423, #424).
kayg closed this issue 2026-10-26 08:46:22 +00:00
Sign in to join this conversation.
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#414
No description provided.