Summary
When db.store_enrichment(...) is called from an external script/loop, the caller's db.conn is never committed, so the enrichment table writes are rolled back.
Verified: inserting 146 tracks via db.store_enrichment(...) (without an explicit db.conn.commit()) left only 2 rows in the enrichment table.
enrich_pending does commit inside its loop, but store_enrichment itself does not commit, and external callers are not told they must.
Impact
Enrichment data (BPM / camelot / energy) is silently discarded. Downstream resequence then reports "no mixing data" for tracks that were supposedly enriched.
Expected
store_enrichment should either:
- commit internally, or
- be clearly documented as requiring the caller to commit, or
- be wrapped so any public entry point commits after storing.
Reproduction
- From a script, call
db.store_enrichment(track_id, ...) for many tracks (no explicit commit).
- Check
SELECT COUNT(*) FROM enrichment — far fewer rows than stored.
Summary
When
db.store_enrichment(...)is called from an external script/loop, the caller'sdb.connis never committed, so theenrichmenttable writes are rolled back.Verified: inserting 146 tracks via
db.store_enrichment(...)(without an explicitdb.conn.commit()) left only 2 rows in theenrichmenttable.enrich_pendingdoes commit inside its loop, butstore_enrichmentitself does not commit, and external callers are not told they must.Impact
Enrichment data (BPM / camelot / energy) is silently discarded. Downstream
resequencethen reports "no mixing data" for tracks that were supposedly enriched.Expected
store_enrichmentshould either:Reproduction
db.store_enrichment(track_id, ...)for many tracks (no explicit commit).SELECT COUNT(*) FROM enrichment— far fewer rows than stored.