fix(search): decode Spotify plural result containers - #59
Merged
Conversation
Contributor
|
馃馃憖 Pull request received. I will update this pull request when review starts. |
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. |
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.
Spotify search requests use singular types such as
track, but successful responses wrap results in plural containers such astracks. Both the Web API client and Connect's Web API fallback looked up the singular key and reportedmissing track resultfor 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
12fed0bcin #57. Thanks @VACInc; the commit includes their original author email in aCo-authored-bytrailer, 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:
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 90passes the full suite: Total coverage: 90.6%.golangci-lint run: 0 issues. The CI-pinned dead-code check produces no findings;git diff --checkpasses.go build -o /tmp/spogo-search-response-proof ./cmd/spogo. Both--helpandsearch track --helpexit 0.--engine web --timeout 10s --json search track weezer --limit 1exits 3 withno 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.