From 6f9ba428d5ab4c5073f95f2be9220be71d820d01 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sat, 19 Sep 2026 07:10:43 +0200 Subject: [PATCH] fix(playlists): the move's conflict fallback says why it is silent The house guard requires a silent handler to carry a silent-ok note; the savepoint fallback added in e74986cc did not, and the gate's pytest lane caught it. --- backend/app/routes/playlists.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/routes/playlists.py b/backend/app/routes/playlists.py index 646dcf3d..1256a6e1 100644 --- a/backend/app/routes/playlists.py +++ b/backend/app/routes/playlists.py @@ -587,8 +587,10 @@ def move_item( item.position = _next_item_position(db, dst.id) db.flush() dst_changed = True + # silent-ok: the conflict IS the answer — the target already holds the video, which is the + # idempotent outcome; the savepoint put the row back in the source list, dropped below. except IntegrityError: - pass # the savepoint put the row back in the source list; drop it below + pass if not dst_changed: db.delete(item) # The source always changed; the target only when the row landed in it. `_touch` on a target