Files
kima-hub/backend
Your Name a56abd4bbb chore: post-review hardening for Deezer proxy, scanner, and preview hook
Four small fixes surfaced in the pre-release review pass:

1. Preview stream upstream cleanup on client disconnect
   Both new Deezer preview proxy endpoints (/artists/preview/.../stream
   and /playlists/.../preview/stream) now register res.on('close', ...)
   to destroy the upstream axios stream when the client goes away.
   Matches the existing audiobook stream pattern. Prevents upstream
   TCP connection leaks when a user cancels a preview mid-flight.

2. Collapse IDOR message oracle in getOwnedPendingTrack
   The pending-track-not-found (404) and wrong-playlist (404) branches
   returned distinguishable error messages, letting an authenticated
   user probe existence of other users' pending track IDs by supplying
   their own playlist ID. Both branches now return the same generic
   'Pending track not found' message.

3. Remove dead request-id guard in useTrackPreview
   After the refactor to direct stream URLs in PR #178, the check
   `if (requestId !== previewRequestIdRef.current) return` runs
   immediately after the increment and is definitionally false.
   Removed the check and the now-unused ref declaration.

4. Array guard for music-metadata discsubtitle field
   music-metadata normally returns discsubtitle as a string, but
   some tag formats (e.g., Vorbis with multiple DISCSUBTITLE frames)
   can surface arrays. Added an explicit Array.isArray branch so a
   future shape change doesn't silently write stringified arrays
   to the database.

Found during pre-release review.
2026-04-07 18:15:22 -05:00
..
2025-12-25 18:58:06 -06:00
2025-12-25 18:58:06 -06:00
2025-12-25 18:58:06 -06:00
2025-12-25 18:58:06 -06:00
2026-04-06 15:37:48 -05:00