fix(artwork): clear the last_failure default left by the trace migration

20260819204637 added last_failure as NOT NULL DEFAULT '[]', so every row
already in item_artwork was backfilled with a non-empty value. Nothing
read that column until this PR, which uses non-empty to mean "this state
was reached by exhausting the retry budget". Every absent row predating
that migration therefore reported as failed.

The consequence is the opposite of what --source failed is for: on an
install with a large absent population it would enqueue all of it, which
is the external-lookup burst the option exists to avoid.

My own database had ten such playlist rows, attempted 2026-08-17 against
a migration applied 2026-08-31, and artwork status called all ten failed.
After this it reads 10 no image, 0 failed.

Normalizing the data rather than excluding '[]' in the predicate, because
an empty trace does encode as '[]' — no reachable give-up path produces
one today, but relying on that would silently drop a real give-up out of
the failed set if a future failure path skipped its trace.
This commit is contained in:
Deluan 2026-09-01 18:58:53 -04:00
parent 60fff953de
commit 6b88327089

View File

@ -0,0 +1,9 @@
-- +goose Up
-- 20260819204637 added last_failure with DEFAULT '[]', so every row already in the table got a
-- non-empty value. That is how a give-up is now told apart from a definitive "no image", which
-- would report every pre-existing absent row as failed.
UPDATE item_artwork SET last_failure = '' WHERE last_failure = '[]';
-- +goose Down
-- Irreversible: a genuine give-up and a backfilled default are indistinguishable once normalized.
SELECT 1;