Home open: persistent index, direct lookups, never 'not found' while scanning #52

Closed
opened 2026-10-13 19:07:14 +00:00 by kayg · 0 comments
Owner

Found while installing the migrated Home on next (#12): a Home is only opened on its first request, and the full scan of 693 notes took 5-14 s (HDD copy). Meanwhile notes.list returns partial results and notes.get for a not-yet-indexed id fails as "not found". That breaks ADR 0016 (startup never waits) from the user's point of view and would show a wrong "not found".

Fix:

  • Persist the notes index across restarts (index.db), validate it incrementally (mtime/size/hash) instead of a full rescan, so a warm open is near-instant even at 100k notes.
  • notes.get (and room join) for an id not yet indexed resolves directly (ids.jsonl / file lookup), never "not found" while scanning.
  • List/summary queries return what exists plus an incomplete flag; the UI shows a quiet "Still updating…".
  • Open the Home eagerly in the background at server start (never blocking /healthz).
  • Gate in the perf harness (#44): cold and warm open at 1k/10k/100k.
Found while installing the migrated Home on next (#12): a Home is only opened on its first request, and the full scan of 693 notes took 5-14 s (HDD copy). Meanwhile `notes.list` returns partial results and `notes.get` for a not-yet-indexed id fails as "not found". That breaks ADR 0016 (startup never waits) from the user's point of view and would show a wrong "not found". Fix: - Persist the notes index across restarts (index.db), validate it incrementally (mtime/size/hash) instead of a full rescan, so a warm open is near-instant even at 100k notes. - `notes.get` (and room join) for an id not yet indexed resolves directly (ids.jsonl / file lookup), never "not found" while scanning. - List/summary queries return what exists plus an `incomplete` flag; the UI shows a quiet "Still updating…". - Open the Home eagerly in the background at server start (never blocking /healthz). - Gate in the perf harness (#44): cold and warm open at 1k/10k/100k.
kayg closed this issue 2026-10-13 19:35:57 +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#52
No description provided.