fix(convex): scale library scans without changing search or playback #107

Merged
joshuafhiggins merged 2 commits from t3/review-prs-102-91 into main 2026-11-16 22:06:05 -05:00
Owner

Library scans repeatedly rewrite unchanged songs and covers, and loading the entire library in single queries makes large scans fail.

Combines the scanner fixes from #91 and #102: paginated reads, one disk walk, changed-only batched writes, a scan lease, atomic album imports, stable same-title paths and covers, and unknown release years. A renamed file inside an album keeps its song ID. An empty disk snapshot refuses to erase an existing library.

Search, browse and queue construction retain main's implementation. This avoids #102's loss of track-artist search, exclusion of earlier songs from shuffle, and silent 1,000-song queue limit. Search and queue scaling remain deferred, including their existing whole-library reads.

Validation: all workspace typechecks pass; formatting and diff checks pass. A focused scanner test exercises unchanged rescans, same-title siblings, multi-codec covers, renames preserving IDs, lock refusal, and the empty-library safeguard. Search, browse and sorted queue code were verified identical to main. No live backend or deployment was touched.

Supersedes #91 and the scanner portion of #102.

Created with GPT-6.1 Sol in the Codex harness through T3 Code. Incorporates scanner work by Claude Opus 5.5 from the original PRs.

Library scans repeatedly rewrite unchanged songs and covers, and loading the entire library in single queries makes large scans fail. Combines the scanner fixes from #91 and #102: paginated reads, one disk walk, changed-only batched writes, a scan lease, atomic album imports, stable same-title paths and covers, and unknown release years. A renamed file inside an album keeps its song ID. An empty disk snapshot refuses to erase an existing library. Search, browse and queue construction retain main's implementation. This avoids #102's loss of track-artist search, exclusion of earlier songs from shuffle, and silent 1,000-song queue limit. Search and queue scaling remain deferred, including their existing whole-library reads. Validation: all workspace typechecks pass; formatting and diff checks pass. A focused scanner test exercises unchanged rescans, same-title siblings, multi-codec covers, renames preserving IDs, lock refusal, and the empty-library safeguard. Search, browse and sorted queue code were verified identical to main. No live backend or deployment was touched. Supersedes #91 and the scanner portion of #102. Created with GPT-6.1 Sol in the Codex harness through T3 Code. Incorporates scanner work by Claude Opus 5.5 from the original PRs.
joshuafhiggins added 1 commit 2026-11-16 20:13:25 -05:00
joshuafhiggins added 1 commit 2026-11-16 22:05:59 -05:00
# Conflicts:
#	apps/mobile/components/app-intent-bridge.tsx
#	packages/convex/convex/library.ts
joshuafhiggins merged commit dbb774df0d into main 2026-11-16 22:06:05 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshuafhiggins/otunes#107