Files
silo-server/internal/scanner
885354e573 fix(scanner): repair invalid CTE that made UpdateEpisodeLink fail on every call (#321)
The statement ended with SELECT COUNT(*) FROM inserted, but the inserted
CTE has no RETURNING clause — PostgreSQL rejects referencing such a CTE
(SQLSTATE 0A000), so every UpdateEpisodeLink call has errored since #283.
The sole caller logs a warning and continues, so the metadata-side
single-file episode relink silently did nothing: episode_id stayed stale,
episode_libraries rows were not inserted, latest_episode_added_at was not
bumped. Bulk linking uses the correct pattern and masked the breakage.

The INSERT is now the top-level statement; the count was unused.
Verified against a migrated PostgreSQL scratch database:
TestEpisodeLinkMaintainsLatestEpisodeAdded fails on main with the exact
error and passes with this change.

Fixes #320

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 12:23:56 -04:00
..
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00
2026-05-22 23:26:56 -04:00