feat(api): embed pending collaborator invites on the owner's own tracks#947
Merged
Merged
Conversation
The edit form initializes its collaborators field from the track response, which only carried accepted collaborators — so re-saving a track dropped any still-pending invites (the ETL reconciles the metadata set and removes rows not present). Expose the owner's pending invites so the client can preserve them. - GetTrackCollaborators now returns accepted + pending (with status); the embed splits them: `collaborators` (accepted) on every response as before, plus a new `pending_collaborators` populated only on the requester's own tracks. - Owner-scoped: pending user IDs are resolved and embedded only for tracks where owner == my_id, so pending invites never surface to other viewers. - swagger: declare `pending_collaborators` on the track schemas. Test: owner sees the pending invite, non-owner sees only accepted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
raymondjacobson
added a commit
to AudiusProject/apps
that referenced
this pull request
Jun 10, 2026
The edit form seeded its collaborators field from the track's accepted-only `collaborators`, so saving dropped any still-pending invites (the ETL reconciles the metadata set). Initialize the field from accepted + pending instead. - SDK Track/SearchTrack: add `pendingCollaborators` (hand-edit stopgap; the API swagger now declares `pending_collaborators` in AudiusProject/api#947, so the next regen reproduces this). - Track model + adapter: expose `pending_collaborators` (owner-only). - Web + mobile edit screens: seed the collaborators field with `[...collaborators, ...pending_collaborators]` so pending invites survive a save. Display still uses accepted-only `collaborators` (no regression). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Backend for the apps edit-form fix: an owner editing a track was dropping still-pending collaborator invites, because the edit form seeds its collaborators field from the track response — which only carried accepted collaborators. On save, the ETL reconciles the metadata set and removes any invite not present, so pending ones vanished.
Change
GetTrackCollaboratorsnow returns accepted and pending rows (withstatus). The embed splits them:collaborators— accepted, on every track response (unchanged behavior).pending_collaborators— new, populated only on the requester's own tracks.owner == my_id, so pending invites never surface to other viewers. (They're public on-chain regardless, but there's no reason to hand them to everyone.)pending_collaboratorsdeclared on the track schemas.Follow-up (apps)
The edit form will initialize from
collaborators+pending_collaboratorsso saving preserves pending invites. Needs an SDK regen once this deploys (the field reproduces cleanly, same ascollaborators).Tests
TestPendingCollaboratorsVisibleToOwnerOnly: owner sees the pending invite; a non-owner sees only the accepted collaborator. Existing collaborator/embed/profile suites still pass.Perf
Same bounded, index-served embed query as before (PK leads on
track_id,ANY(@ids)); it now also returnspendingrows, post-filtered by the same index. No new round-trips.🤖 Generated with Claude Code