fix(syndesmos): correct Last.fm and Tidal integrations - #481
Merged
Conversation
- #390: md5_hex computes a real MD5 digest; it was hex-encoding the raw input bytes, so api_sig reversibly leaked the shared_secret. - #391: submit_scrobble includes the api_sig form parameter; Last.fm rejected every scrobble (error 13) without it. - #392: sync_tidal_want_list diffs favorites against persisted wants and now persists fresh favorites as wants (source='tidal_sync', source_ref = tidal_id), closing the re-add-on-every-sync loop. Adds apotheke list_want_source_refs + a wants(source, source_ref) index migration. - #421: error_for_status at the four external HTTP call sites; 4xx/5xx bodies were treated as success. - #422: scrobble() resolves and submits the track's real artist/title/ album; it hardcoded an empty artist on every scrobble. - #423: the scrobble test asserts the submitted artist. Closes #390 Closes #391 Closes #392 Closes #421 Closes #422 Closes #423 Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:33c8623da9f866574be81200ba191ca83c0fb438
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.
Closes #390, #391, #392, #421, #422, #423.
Changes
md5_hexhex-encoded the raw input bytes instead of computing an MD5 digest, so the Last.fmapi_sigwas a reversible encoding of the signing string — leakingshared_secret. Nowmd5::compute. Known-answer + fixed-width tests.submit_scrobblenever included theapi_sigform parameter, so Last.fm rejected every scrobble (error 13). Signs the params and appendsapi_sig; wire-level test asserts it is in the POST body.sync_tidal_want_listpassed an empty existing-ID set, re-adding every favorite on every sync, and never persisted the favorites it found. Now it diffs against persisted wants (new indexedapotheke::repo::want::list_want_source_refs+ awants(source, source_ref)migration) and persists each fresh favorite as a want (source='tidal_sync',source_ref=tidal_id), closing the loop. A round-trip test proves a second sync of unchanged favorites adds zero..error_for_status()at each.scrobble()hardcoded an empty artist; it now resolves and submits the track's real artist/title/album (new apotheke metadata join).Verification
kanon gate --fullgreen (fmt, check, advisory-parity, cargo-deny, clippy workspace, nextest 1192 tests, kanon lint). Test HTTP interactions use an in-crate one-shot TCP server (no new workspace deps beyondmd5).Note
The Tidal-favorite→want persistence uses
status='searching'; no acquisition poller consumes searching-wants yet, so this populates the want baseline without triggering downloads (the intended semantics until a search loop lands).