Repository navigation
fix(spotify): migrate to the February 2026 Web API endpoints - #94
Conversation
Spotify removed six endpoints the web client still called, so playlist
creation and artist follow/unfollow failed with 403 for every app in
Development Mode.
- POST /users/{user_id}/playlists -> POST /me/playlists, which drops the
currentUserID() lookup that only existed to build that URL
- GET/POST/DELETE /playlists/{id}/tracks -> /items, with the body parameter
tracks renamed to items
- PUT/DELETE /me/following -> PUT/DELETE /me/library with
uris=spotify:artist:...
- decode items.total and the item wrapper, which are the 2026 shapes, while
still accepting tracks.total and the track wrapper because Extended Quota
Mode apps keep receiving the old field names
Search asks for at most ten results per request and pages with offset until the caller limit is met or the results run out. Development Mode apps reject a limit above ten with 400 Invalid limit, so the CLI default of twenty failed for every web-engine search, not only for callers passing a large limit. The result keeps the caller limit and offset and carries the upstream total from the first page.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR updates Spotify Web API endpoints, accepts both playlist response formats, and retrieves larger searches in pages of ten. Example: Run spogo --engine web --auth oauth search track "weezer" with a Development Mode app.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: main still needs the migration, the updated terminal capture clears the earlier proof gap, and no actionable code or security defect was found. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCLI commands reach the shared authenticated Web API client through engine routing; Spotify responses are mapped into structured items and terminal output. flowchart TD
A[CLI commands] --> B[Engine routing]
B --> C[Shared Web API client]
C --> D[Spotify API]
D --> E[Response mapping]
E --> F[CLI output]
Technical reviewBest possible solution: Land the focused migration in the shared Web API client while preserving CLI contracts, legacy response decoding, and existing engine routing. Do we have a high-confidence way to reproduce the issue? Main sends the retired requests documented by Spotify, corroborated by RtYkk's v0.13.2 failures and successful branch CLI output; this read-only review executed no target code. Is this the best way to solve the issue? Updating the existing shared client addresses the upstream contract change directly, preserves requested search counts, and retains older response decoding without adding another implementation. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 61001a475be7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 15, 2026, 10:11 AM ET / 15:11 UTC (Revision 4). |
Spotify removed PUT and DELETE on /me/tracks, /me/albums, /me/episodes and /me/shows in the February 2026 Web API change, so library tracks add/remove and library albums add/remove failed with 403 for Development Mode apps. LibraryModify now takes the entity kind instead of a path and writes uris=spotify:<kind>:<id> to /me/library, which is the documented replacement.
Spotify accepts a maximum offset of 1000 on /search, so a page requested past it returns 400 and discards the results already collected. Paging now stops at the ceiling instead of asking for a page that cannot exist.
|
Captured terminal output, addressing the two findings from the last review. Offset ceiling. Paging now stops at offset 1000. The new test TestSearchStopsAtMaximumOffset asks for limit=20 at offset=995 and asserts a single request, with no attempt at 1005. Library writes. library tracks add/remove and library albums add/remove still used the removed PUT and DELETE on /me/tracks and /me/albums, which the review flagged as an incomplete migration. LibraryModify now takes the entity kind and writes uris=spotify:: to /me/library. spogo below is the released 0.13.2; ./spogo is built from this branch. The library section checks each step with /me/library/contains, so the add and remove are confirmed rather than self-reported. Only catalogue identifiers and a public Spotify playlist appear below. go vet ./... , go test ./... and gofmt -l internal/ are clean. The search paging tests run with: go test ./internal/spotify -run ^TestSearch |
|
Both review findings are addressed in the commits after df1e53b: paging stops at the offset ceiling, and library track/album writes moved to /me/library. Captured before/after terminal output is in the previous comment. Requesting a fresh review. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Migrate removed endpoints, retain both playlist response shapes, page search results, and batch library mutations at 40 URIs. Document unknown Connect playlist counts. Refresh compatible dependencies and use Go 1.27.4 for GO-2026-6859 while retaining the Go 1.26.7 source minimum. Validated with regression tests, race coverage, vulnerability scan, lint, deadcode, CLI/docs smoke, and independent review. Co-authored-by: RtYkk <45971730+RtYkk@users.noreply.github.com>
steipete
left a comment
There was a problem hiding this comment.
Reviewed the endpoint migration, 40-URI batching, response compatibility, and search pagination. Regression tests, Go 1.27.4 vulnerability scan, race coverage, lint, and independent P0–P2 review passed.
Change
Restore Spotify Development Mode operations after the February 2026 API migration: create playlists through
/me/playlists, use playlist/itemsendpoints, and save/remove/follow through/me/library. Accept both current and Extended Quota response shapes, including an explicit zero count.Search requests page at ten results while retaining the caller's requested count and offset. Library mutations use batches of at most 40 URIs and stop at the first failed batch, preserving operations that exceeded the replacement endpoint's smaller limit.
Refresh compatible Go dependencies and build with Go 1.27.4 to fix the reachable GO-2026-6859 HTTP-server vulnerability. The source minimum remains Go 1.26.7. Document Connect's unavailable playlist counts without changing JSON/plain output or issuing a request per playlist.
Fixes #93. Resolves #96 through its documented-limitation option.
Validation
Reproduced the old search behavior with failing tests: requests for 25 and 15 results were sent as single oversized requests. Reproduced the unbatched library failure for track/album/artist saves and removals against a synthetic endpoint enforcing the 40-URI limit.
The affected Spotify, CLI, and cookie packages pass locally. Independent P0–P2 review identified the missing mutation batching; the completed fix passed a fresh independent review. Final isolated Linux proof on Go 1.27.4 passed: race coverage 90.7%,
go vet ./..., deadcode v0.52.0, no findings from the currentgovulncheck, golangci-lint v2.15.0, built CLI version/completion smoke, and docs generation. A discovered empty-input batching regression was fixed and the full final gate rerun. Hosted exact-head CI passed on Linux, Windows, and macOS before merge.The contributor's original live Development Mode evidence remains available at https://gist.github.com/RtYkk/1a82179076d9de81afba11a77f3327c7. Maintainer verification uses synthetic HTTP servers; no personal Spotify account or library was changed.
No application version change, tag, or release.