Sync: reject duplicate positions before mutation #40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Independent review found that duplicate remote track positions reach the SQLite membership constraint only after automatic matching has written beets associations. Sync then fails but leaves partial beets mutations, contrary to the fetch/validate-before-mutate rule in
SPEC.md.Task
Validate each fetched playlist's occurrence positions before opening or mutating plugin state, beets metadata, or playlistmanager contents. Reject duplicate positions with an actionable error naming the playlist and position.
Acceptance criteria
main.Completed in
coop/beets-appleplaylistsby implementation commited04e9d, merged through PR #41 ase4fbbffd4a0bf744d4967c6bfb03e4ffe369869a.Duplicate positions are now rejected before any beets, plugin-state, or playlistmanager mutation. The regression test verifies all three stores remain unchanged; valid repeated tracks at distinct positions remain covered.
Validation: 104 tests passed with warnings promoted to errors, plus Ruff lint/format checks for these files, compileall, isolated CLI help, package build, and
git diff --check.