Conversation
🦋 Changeset detectedLatest commit: ffa92c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
raymondjacobson
left a comment
There was a problem hiding this comment.
confirming things work for private / hidden playlists
There was a problem hiding this comment.
Pull request overview
Regenerates the Audius SDK and docs to remove getPlaylistByHandleAndSlug in favor of using getBulkPlaylists with permalink, and aligns comment-write responses with other write endpoints.
Changes:
- Removed
getPlaylistByHandleAndSlugfrom the generated Playlists API and addedpermalinksupport togetBulkPlaylists. - Updated generated write response models (
WriteResponse,Create*Response) to return chain receipt fields (transaction hash + block hash/number) instead ofsuccess. - Updated embed client and common collection-by-permalink query to call
getBulkPlaylists({ permalink: [...] }), and updated API/SDK docs accordingly.
Reviewed changes
Copilot reviewed 9 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/sdk/api/generated/default/models/WriteResponse.ts | Removes success and adds chain receipt fields to write responses. |
| packages/sdk/src/sdk/api/generated/default/models/CreateUserResponse.ts | Updates create-user response shape to chain receipt fields. |
| packages/sdk/src/sdk/api/generated/default/models/CreateTrackResponse.ts | Updates create-track response shape to chain receipt fields. |
| packages/sdk/src/sdk/api/generated/default/models/CreatePlaylistResponse.ts | Updates create-playlist response shape to chain receipt fields. |
| packages/sdk/src/sdk/api/generated/default/models/CreateDeveloperAppResponse.ts | Adds block hash/number to developer app creation response. |
| packages/sdk/src/sdk/api/generated/default/models/CreateCommentResponse.ts | Updates create-comment response shape to chain receipt fields. |
| packages/sdk/src/sdk/api/generated/default/apis/PlaylistsApi.ts | Adds permalink query param to getBulkPlaylists and removes getPlaylistByHandleAndSlug. |
| packages/sdk/src/sdk/api/comments/CommentsAPI.ts | Adjusts several comment writes to return the entity-manager receipt instead of { success: true }. |
| packages/embed/src/util/BedtimeClient.js | Uses getBulkPlaylists with permalink to fetch collections by permalink. |
| packages/embed/src/components/app.jsx | Updates request typing for album vs playlist permalinks when fetching collections. |
| packages/common/src/api/tan-query/collection/useCollectionByPermalink.ts | Switches to getBulkPlaylists({ permalink: [...] }) for permalink lookup. |
| docs/docs/developers/sdk/playlists.mdx | Updates SDK docs for getBulkPlaylists to include permalink. |
| docs/docs/developers/openapi.yaml | Adds permalink param to bulk playlists, removes by-permalink endpoint, updates write schemas. |
| docs/docs/developers/api/sidebar.ts | Removes the removed endpoint from the API sidebar. |
| docs/docs/developers/api/sidebar.generated.js | Mirrors sidebar removal in generated sidebar output. |
| .changeset/four-peas-impress.md | Declares a major SDK change and documents migration. |
Comments suppressed due to low confidence (1)
docs/docs/developers/api/sidebar.ts:520
- The sidebar entry for
get-playlist-by-handle-and-slugwas removed, but the doc pagedocs/docs/developers/api/get-playlist-by-handle-and-slug.api.mdxstill exists. If the endpoint is removed, consider deleting that doc page (or adding a redirect/deprecation notice) to avoid publishing stale docs at a direct URL.
{
type: "category",
label: "playlists",
items: [
{
type: "doc",
id: "developers/api/get-bulk-playlists",
label: "Get Bulk Playlists",
className: "api-method get",
},
{
type: "doc",
id: "developers/api/create-playlist",
label: "Create Playlist",
className: "api-method post",
},
{
type: "doc",
id: "developers/api/search-playlists",
label: "Search Playlists",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 16 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const metadata: EntityManagerReactCommentRequest = { | ||
| userId: params.userId, | ||
| commentId: params.commentId, | ||
| isLiked: true, | ||
| trackId: params.commentId // trackId represents the entity being commented on | ||
| } |
There was a problem hiding this comment.
In the entity-manager path for reacting to a comment, trackId is being set to params.commentId, but trackId should represent the entity (track) the comment is on (i.e. params.metadata.entityId). As written, the relay metadata will reference the comment id as the track id, which can cause the reaction write to be attributed to the wrong entity or rejected. Populate trackId from params.metadata.entityId (encoded as a hash id, consistent with other entity-manager helpers) instead of params.commentId.
| const metadata: EntityManagerReactCommentRequest = { | ||
| userId: params.userId, | ||
| commentId: params.commentId, | ||
| isLiked: false, | ||
| trackId: params.commentId | ||
| } |
There was a problem hiding this comment.
In the entity-manager path for unreacting to a comment, trackId is set to params.commentId, but trackId should be the entity (track) id from params.metadata.entityId. Using the comment id here makes the on-chain/relay metadata inconsistent with the API request and can break unreact writes. Set trackId based on params.metadata.entityId (encoded as a hash id) instead.
| const metadata: EntityManagerPinCommentRequest = { | ||
| userId: params.userId, | ||
| entityId: params.commentId, | ||
| trackId: params.commentId, // trackId represents the entity being commented on | ||
| isPin: true | ||
| } |
There was a problem hiding this comment.
In the entity-manager path for pinning a comment, trackId is set to params.commentId, but trackId should be derived from params.metadata.entityId (the entity/track the comment is on). With the current mapping, the pin write metadata will reference the wrong entity. Set trackId from params.metadata.entityId (encoded as a hash id) instead.
| @@ -313,10 +293,7 @@ | |||
| trackId: params.commentId, | |||
There was a problem hiding this comment.
In the entity-manager path for unpinning a comment, trackId is set to params.commentId, but it should represent the entity (track) id from params.metadata.entityId. Using the comment id here makes the relay metadata incorrect and can break unpin writes. Populate trackId from params.metadata.entityId (encoded as a hash id) instead.
| trackId: params.commentId, | |
| trackId: encodeHashId(params.metadata.entityId), |
Regenerates the SDK following AudiusProject/api#678 and AudiusProject/api#677
getPlaylistByHandleAndSlugin favor of callinggetBulkPlaylistswith permalink arggetBulkPlaylists