Skip to content

fix: bootstrap deadlock and silent empty merge on fresh install#13

Merged
gitcoder89431 merged 2 commits into
mainfrom
fix/bootstrap-deadlock-and-missing-schema
May 14, 2026
Merged

fix: bootstrap deadlock and silent empty merge on fresh install#13
gitcoder89431 merged 2 commits into
mainfrom
fix/bootstrap-deadlock-and-missing-schema

Conversation

@gitcoder89431
Copy link
Copy Markdown
Owner

Summary

  • InitUserDB() was missing the stations, tracks, indexes, and FTS virtual table — SQLite's OR IGNORE silently swallowed the "no such table" error so bootstrap always reported 0 tracks merged on a fresh install
  • seedDemoPlaylists() deadlocked because it held a query cursor open while issuing follow-up queries on the same SetMaxOpenConns(1) connection

What was tested

  • Verified on macOS 15 arm64 (Apple Silicon) — clean install, bootstrap now correctly merges 5 stations and 8034 tracks
  • doctor shows all green after bootstrap
  • sync runs successfully against live YouTube channels

Related issues

Closes #7
Closes #10

🤖 Generated with Claude Code

gitcoder89431 and others added 2 commits May 14, 2026 01:50
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>
@gitcoder89431 gitcoder89431 merged commit cdf85ff into main May 14, 2026
2 checks passed
@gitcoder89431 gitcoder89431 deleted the fix/bootstrap-deadlock-and-missing-schema branch May 14, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant