Conversation
427c38c changed five playlist owner lookups from `select: { user: { id: true } }` to `select: { userId: true, user: { id: true } }`. Naming a real root column makes TypeORM honour the partial select literally, so `Playlist.id` is no longer selected. Because these calls also pass `relations: { user: true }`, TypeORM wraps the query in its DISTINCT pagination subquery, which references `distinctAlias.Playlist_id` — a column the SELECT list no longer contains. Postgres rejects the whole statement before a row is read: QueryFailedError: column distinctAlias.Playlist_id does not exist The throw happens regardless of whether the playlist exists, so these endpoints return 500 unconditionally — including for requests that should 404: POST /playlist/:uuid/keyframe DELETE /playlist/:uuid PUT /playlist/:uuid/order DELETE /playlist/:uuid/remove-item/:itemId DELETE /playlist/:uuid/keyframe/:playlistKeyframeId The same commit's other call sites (handleGetPlaylistItems, handleGetPlaylistPlaybackItems, handleGetPlaylistKeyframes, loadPlaylistForOwnerAction) already select `id`, which is why reads and the new batch item endpoint are unaffected. Add `id: true` to the five selects, and a table-driven regression test asserting every owner-action lookup selects the primary key. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Awfsre2EbKhYRoWtpnW6Lg
fix: select playlist primary key in owner-action lookups
expose dream progress and playlist processing summaries
order job progress by a redis sequence instead of wall-clock timestamps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.