fix: bootstrap deadlock and silent empty merge on fresh install#13
Merged
Merged
Conversation
Two bugs prevented bootstrap from working on a clean install: 1. InitUserDB() did not create the stations, tracks, indexes, or FTS virtual table. SQLite's OR IGNORE silently swallows "no such table" errors, so INSERT OR IGNORE INTO stations/tracks did nothing and returned nil — bootstrap reported success with 0 tracks merged. Fix: add the full stations/tracks schema to InitUserDB(). 2. seedDemoPlaylists() held a Query cursor open while issuing follow-up QueryRow/Exec calls on the same connection. With SetMaxOpenConns(1) this deadlocked. Fix: drain cursor into a []string slice, close it, then process names. Closes #7, closes #10 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InitUserDB()was missing thestations,tracks, indexes, and FTS virtual table — SQLite'sOR IGNOREsilently swallowed the "no such table" error so bootstrap always reported 0 tracks merged on a fresh installseedDemoPlaylists()deadlocked because it held a query cursor open while issuing follow-up queries on the sameSetMaxOpenConns(1)connectionWhat was tested
bootstrapnow correctly merges 5 stations and 8034 tracksdoctorshows all green after bootstrapsyncruns successfully against live YouTube channelsRelated issues
Closes #7
Closes #10
🤖 Generated with Claude Code