Unbounded growth: search_clicks, lyrics_index, and stale queue source #249

Open
opened 2026-09-09 13:57:49 +00:00 by yonlu · 1 comment
Owner

Report

Three persisted surfaces grow without bound, and one cosmetic fact goes
stale. These are not data loss, so they are one janitorial issue rather
than three.

Findings

  • search_clicks (Authored, Retained) has no ceiling. Deliberately
    retained, but every distinct query→MBID the user clicks is a row
    forever; nothing states a bound.
  • lyrics_index rows are never pruned on track removal. The orphan and
    RemoveFromLibrary paths call DeleteSearchIndex for the library
    FTS but nothing touches lyrics_index. Harmless to results (the
    search inner-joins track_metadata, so dead rowids drop out) but the
    index grows. contentless_delete=1 makes a single-row delete valid,
    so this is cheap to fix.
  • queue.source_type/source_id/source_label go stale when their source
    playlist or library is deleted — the player still says "Playing from: X"
    for something that no longer exists. Cosmetic.

Direction

  • Give search_clicks a documented budget or a TTL (it is behavioural
    ranking data; a cap on retained rows is enough).
  • Prune the lyrics_index entry (and the lyrics row, which already
    cascades) where DeleteSearchIndex is already called.
  • Clear or re-resolve queue.source_* on playlist/library deletion.
**Report** Three persisted surfaces grow without bound, and one cosmetic fact goes stale. These are not data loss, so they are one janitorial issue rather than three. **Findings** - `search_clicks` (`Authored, Retained`) has no ceiling. Deliberately retained, but every distinct query→MBID the user clicks is a row forever; nothing states a bound. - `lyrics_index` rows are never pruned on track removal. The orphan and `RemoveFromLibrary` paths call `DeleteSearchIndex` for the library FTS but nothing touches `lyrics_index`. Harmless to results (the search inner-joins `track_metadata`, so dead rowids drop out) but the index grows. `contentless_delete=1` makes a single-row delete valid, so this is cheap to fix. - `queue.source_type/source_id/source_label` go stale when their source playlist or library is deleted — the player still says "Playing from: X" for something that no longer exists. Cosmetic. **Direction** - Give `search_clicks` a documented budget or a TTL (it is behavioural ranking data; a cap on retained rows is enough). - Prune the `lyrics_index` entry (and the `lyrics` row, which already cascades) where `DeleteSearchIndex` is already called. - Clear or re-resolve `queue.source_*` on playlist/library deletion.
yonlu added the Kind/Enhancement
Priority
Low
4
Platform/AndroidPlatform/Desktop
labels 2026-09-09 13:57:49 +00:00
yonlu self-assigned this 2026-09-09 13:58:20 +00:00
yonlu added the
Status
In Progress
label 2026-09-09 13:58:21 +00:00
Author
Owner

Branch: fix/249-unbounded-growth

Approach: prune lyrics_index on the removal paths where DeleteSearchIndex is already called; clear or re-resolve queue.source_* on playlist/library delete; give search_clicks a documented row ceiling or TTL. Small, three independent edits, one PR.

Branch: fix/249-unbounded-growth Approach: prune lyrics_index on the removal paths where DeleteSearchIndex is already called; clear or re-resolve queue.source_* on playlist/library delete; give search_clicks a documented row ceiling or TTL. Small, three independent edits, one PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#249