Skip to content

enrich: store_enrichment data is silently lost (no commit on external callers) #3

Description

@gnujoow-bot

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

  1. From a script, call db.store_enrichment(track_id, ...) for many tracks (no explicit commit).
  2. Check SELECT COUNT(*) FROM enrichment — far fewer rows than stored.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions