Skip to content

fix(search): decode Spotify plural result containers - #59

Merged
steipete merged 1 commit into
mainfrom
fix/search-response-plural-containers
Aug 31, 2026
Merged

fix(search): decode Spotify plural result containers#59
steipete merged 1 commit into
mainfrom
fix/search-response-plural-containers

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Spotify search requests use singular types such as track, but successful responses wrap results in plural containers such as tracks. Both the Web API client and Connect's Web API fallback looked up the singular key and reported missing track result for valid responses. This changes the two lookups to the documented plural keys while preserving request types and result metadata.

Extracted from @VACInc's search-only commit 12fed0bc in #57. Thanks @VACInc; the commit includes their original author email in a Co-authored-by trailer, and the changelog credits them. The OAuth changes are excluded. #57 remains open for separate consideration.

The synthetic fixture follows Spotify's documented search response shape, including plural containers, paging links, item metadata, and nested track artist/album data. The regression covers all six supported search types through both decoding paths and checks that request types stay singular.

Validation:

  • With only the two parser lookups reverted through a temporary Go overlay, all 12 regression cases fail with missing <type> result (exit 1). The same test passes all 12 cases with this fix (exit 0): go test ./internal/spotify -run '^TestSearchDocumentedResponse$' -count=1 -v.
  • ./scripts/check-coverage.sh 90 passes the full suite: Total coverage: 90.6%.
  • golangci-lint run: 0 issues. The CI-pinned dead-code check produces no findings; git diff --check passes.
  • Built the real CLI with go build -o /tmp/spogo-search-response-proof ./cmd/spogo. Both --help and search track --help exit 0.
  • The built CLI's --engine web --timeout 10s --json search track weezer --limit 1 exits 3 with no cookies found. No usable local Spotify authentication was available, so authenticated Spotify search could not be verified. The documented-shape regression and built-binary help/authentication-path checks are the proof ceiling.
  • Codex autoreview is scoped-clean with no accepted/actionable findings at its default P0 scope.

Extract the search-parser fix from PR #57 commit
12fed0b without its OAuth changes.
Read plural containers in both Web API search paths and cover all six
supported search types with a synthetic documented-shape response fixture.

Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

馃馃憖
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(search): decode Spotify plural result containers This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit aef9a7f into main Aug 31, 2026
8 checks passed
@steipete
steipete deleted the fix/search-response-plural-containers branch August 31, 2026 06:41
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