Skip to content

fix: Dedupe track collaborators in API responses#976

Merged
raymondjacobson merged 1 commit into
mainfrom
codex/dedupe-track-collaborators-api
Jun 29, 2026
Merged

fix: Dedupe track collaborators in API responses#976
raymondjacobson merged 1 commit into
mainfrom
codex/dedupe-track-collaborators-api

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Summary

  • Filter embedded track collaborators through an order-preserving de-dupe before resolving API response users.
  • Exclude the track owner from both accepted and pending collaborator arrays as a response-boundary guard.
  • Add unit coverage for the de-dupe helper and extend the collaborator response test for owner-as-collaborator rows.

Notes

The track_collaborators table already has a (track_id, collaborator_user_id) primary key, and the current go-openaudio ETL path already excludes owners and de-dupes collaborator metadata before writing. This API guard is intentionally defensive so malformed rows or future query changes cannot leak duplicate/owner collaborator entries to clients.

Testing

  • go test ./api/dbv1
  • go test ./api -run TestTrackCollaboratorsEmbeddedOnTrack
  • go test ./api/dbv1 ./api -run 'TestUniqueCollaboratorIDs|TestTrackCollaboratorsEmbeddedOnTrack'\n- git diff --check\n

@raymondjacobson raymondjacobson merged commit 2138723 into main Jun 29, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the codex/dedupe-track-collaborators-api branch June 29, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant