fix(maintenance): bound search_clicks and lyrics_index, clear stale queue source #253

Closed
yonlu wants to merge 0 commits from fix/249-unbounded-growth into main
pull from: fix/249-unbounded-growth
Owner
commit issue
4e5c6b9f fix(maintenance): bound search_clicks and lyrics_index, clear stale queue source #249

Verification

  • go test ./backend/database/... ./backend/library/... ./backend/queue/... ./backend/playlist/... ./backend/maintenance/...
  • golangci-lint run .

Three small items: prune lyrics_index on track removal, age out
search_clicks via a daily janitor job, and drop the queue's
"Playing from" label when its source playlist is deleted.

Note: this branch and #246 both touch the orphan loop in
backend/library/library.go; merge #246 first and rebase this one.

Closes #249

| commit | issue | |---|---| | `4e5c6b9f` fix(maintenance): bound search_clicks and lyrics_index, clear stale queue source | #249 | ## Verification - `go test ./backend/database/... ./backend/library/... ./backend/queue/... ./backend/playlist/... ./backend/maintenance/...` - `golangci-lint run .` Three small items: prune `lyrics_index` on track removal, age out `search_clicks` via a daily janitor job, and drop the queue's "Playing from" label when its source playlist is deleted. Note: this branch and #246 both touch the orphan loop in `backend/library/library.go`; merge #246 first and rebase this one. Closes #249
yonlu added 1 commit 2026-09-11 21:14:48 +00:00
fix(maintenance): bound lyrics search and clicks, clear queue source
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Failing after 3m44s
CI / e2e (pull_request) Skipped
88f5524aa2
Three unbounded or stale surfaces, each small on its own:

- lyrics_index rows were never pruned on track removal, so the FTS index
  grew forever. Delete the entry where the library search FTS entry is
  already deleted, on the orphan and RemoveFromLibrary paths.
- search_clicks had no ceiling; age out ranking rows after a retention
  window via a daily janitor job.
- queue.source_* kept a "Playing from X" label after its playlist was
  deleted. Drop the source when the queue's own playlist goes, wired
  through a playlist-service hook like Library.SetRemovalHooks.

Closes #249
yonlu force-pushed fix/249-unbounded-growth from 4e5c6b9f7a to 88f5524aa2 2026-09-11 21:14:48 +00:00 Compare
yonlu added 1 commit 2026-09-21 00:22:32 +00:00
chore(bindings): regenerate for the queue's DropSourceForPlaylist
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 6m50s
CI / e2e (pull_request) Successful in 11m9s
cf90030463
frontend/bindings is generated by wails3 and is not covered by the
codegen pre-commit hook, so the new bound method went out without it and
make bindings-check failed on the PR.
Author
Owner

Closed rather than merged: this branch is in main through PR #255 (main is now a5c3990, batch head 8dbdb7a), which also carries the bindings fix cf900304 that this PR's final CI run was waiting on. 88f5524a is preserved in that history and closed #249.

One conflict with #252 in backend/library/library.go: the orphan-path lyrics delete used audioFile.ID, which is the loop variable before #250 renamed it to f — the auto-merge kept the added lines verbatim and they would not have compiled. Adapted to f.ID in the batch. Everything else in this change merged clean.

Closed rather than merged: this branch is in `main` through PR #255 (main is now `a5c3990`, batch head `8dbdb7a`), which also carries the bindings fix `cf900304` that this PR's final CI run was waiting on. `88f5524a` is preserved in that history and closed #249. One conflict with #252 in `backend/library/library.go`: the orphan-path lyrics delete used `audioFile.ID`, which is the loop variable before #250 renamed it to `f` — the auto-merge kept the added lines verbatim and they would not have compiled. Adapted to `f.ID` in the batch. Everything else in this change merged clean.
yonlu closed this pull request 2026-09-21 02:17:13 +00:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.