Small-fix batch: artist_metadata sweep, and the three unbounded surfaces (#248, #249) #255

Merged
yonlu merged 6 commits from batch/248-249 into main 2026-09-21 02:01:55 +00:00
Owner

Batch: two janitorial fixes reconciled into one merge, so the
combination is verified once instead of leaving main to find it.

commit issue what it does
a205224a (merge of fix/248-artist-metadata-sweep) #248 sweeps artist_metadata rows nothing references
8dbdb7ad (merge of fix/249-unbounded-growth) #249 bounds search_clicks, prunes lyrics_index, clears a stale queue source

Both branches were written against the same base and both add to the
same two registries, so the conflicts are between the two fixes rather
than with main. All four were resolved by keeping both sides:

  • backend/app.go — both branches register a janitor job. Both are
    registered.
  • backend/maintenance/sweeps.go — both append a job at the end of the
    file. Both are kept, each with its own closing tail.
  • backend/maintenance/maintenance_test.go — both append a test. Both
    are kept, as separate functions.
  • backend/library/library.go#249's orphan-path lyrics delete was
    written against the loop variable before #250 renamed it, so the
    audioFile.ID it added no longer exists in that function. Adapted to
    f.ID; nothing else in #249's change needed it.

Verification run locally on this head, before pushing:

  • go build ./backend/... — clean
  • gofmt -l backend/ frontend/ — clean
  • go test ./backend/maintenance/ -run TestStale -v — both new sweeps
    pass (TestStaleArtistMetadataJob, TestStaleSearchClicksJob)
  • go test ./backend/library/ ./backend/queue/ ./backend/playlist/ — pass
    (the library package needs make testdata first, which is why a bare
    run in a fresh worktree fails on the fixture scan)

Supersedes PRs #252 and #253, which are closed rather than merged — their
branches are the two merges above, so their commits and authorship
survive in this history.

Closes #248
Closes #249

Batch: two janitorial fixes reconciled into one merge, so the combination is verified once instead of leaving `main` to find it. | commit | issue | what it does | |---|---|---| | `a205224a` (merge of `fix/248-artist-metadata-sweep`) | #248 | sweeps `artist_metadata` rows nothing references | | `8dbdb7ad` (merge of `fix/249-unbounded-growth`) | #249 | bounds `search_clicks`, prunes `lyrics_index`, clears a stale queue source | Both branches were written against the same base and both add to the same two registries, so the conflicts are between the two fixes rather than with `main`. All four were resolved by keeping both sides: - `backend/app.go` — both branches register a janitor job. Both are registered. - `backend/maintenance/sweeps.go` — both append a job at the end of the file. Both are kept, each with its own closing tail. - `backend/maintenance/maintenance_test.go` — both append a test. Both are kept, as separate functions. - `backend/library/library.go` — #249's orphan-path lyrics delete was written against the loop variable before #250 renamed it, so the `audioFile.ID` it added no longer exists in that function. Adapted to `f.ID`; nothing else in #249's change needed it. Verification run locally on this head, before pushing: - `go build ./backend/...` — clean - `gofmt -l backend/ frontend/` — clean - `go test ./backend/maintenance/ -run TestStale -v` — both new sweeps pass (`TestStaleArtistMetadataJob`, `TestStaleSearchClicksJob`) - `go test ./backend/library/ ./backend/queue/ ./backend/playlist/` — pass (the library package needs `make testdata` first, which is why a bare run in a fresh worktree fails on the fixture scan) Supersedes PRs #252 and #253, which are closed rather than merged — their branches are the two merges above, so their commits and authorship survive in this history. Closes #248 Closes #249
yonlu added 6 commits 2026-09-21 01:41:20 +00:00
fix(maintenance): sweep artist_metadata rows nothing references
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 3m6s
CI / e2e (pull_request) Successful in 11m22s
e745acf88a
artist_metadata was classified Cache/Swept but had no sweep and no
DELETE anywhere, so long-lived entity data (no TTL by design) grew for
the life of the install.  Sweep rows whose MBID is neither a library
artist nor holding cached artwork, and register the job with the
janitor.

Closes #248
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
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.
Merge remote-tracking branch 'origin/main' into fix/248-artist-metadata-sweep
CI / e2e (push) Skipped
CI / check (push) Skipped
CI / check (pull_request) Successful in 3m22s
CI / e2e (pull_request) Successful in 11m43s
a96cc9be1f
Merge branch 'fix/249-unbounded-growth' into batch/248-249
CI / check (push) Skipped
CI / e2e (push) Skipped
CI / check (pull_request) Successful in 3m42s
CI / e2e (pull_request) Successful in 11m12s
8dbdb7ad75
Both branches add to the same two registries, so the conflicts are
between the two fixes rather than with main:

- backend/app.go: both register a janitor job.  Both are registered.
- backend/maintenance/sweeps.go: both append a job at the end of the
  file.  Both are kept, each with its own closing tail.
- backend/maintenance/maintenance_test.go: both append a test.  Both are
  kept as separate functions.
- backend/library/library.go: #249's orphan-path lyrics delete was
  written against the loop variable before #250 renamed it, so its
  `audioFile.ID` no longer exists in that function.  Adapted to `f.ID`.

Closes #248
Closes #249
yonlu merged commit a5c3990d12 into main 2026-09-21 02:01:55 +00:00
Sign in to join this conversation.