Skip to content

fix(deezer): Retry a busy service instead of reading it as no match - #286

Merged
pterw merged 1 commit into
mainfrom
fix/deezer-service-busy
Oct 31, 2026
Merged

pterw merged 1 commit into
mainfrom
fix/deezer-service-busy

Conversation

@pterw

@pterw pterw commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes F-B23-37. Deezer reports errors with HTTP 200 and an error code in the body, and _deezer_request retried only code 4 (quota): every other code was read as a terminal miss, so a busy Deezer was recorded as "this album is not on Deezer". Deezer's documented error table (developers.deezer.com/api/errors, read by the owner on 2026-10-31) lists 700 as SERVICE_BUSY. Code 700 now takes the same path as an HTTP 5xx: retried, then raised as deezer_unavailable, never None. Codes 4 and 800 and unknown codes behave as before.

An outside agent (DeepSeek) wrote the patch in an isolated worktree from a spec-tight prompt; a before-and-after snapshot of the main checkout confirmed it wrote nothing outside its worktree. An independent review approved it (no Critical or Important findings) and reproduced the red proof on unpatched code. The existing test test_deezer_search_5xx_on_every_attempt_raises_unavailable_not_no_match became the parametrized test_deezer_search_refused_on_every_attempt_raises_unavailable_not_no_match (HTTP 500, and HTTP 200 with code 700); no test was added.

Validation at this head

Head 47bf996a. Gates scoped to the change (owner ruling 2026-10-31): suite-subdirs 1512 and suite-core 905 passed, pre-commit (every hook) and docsync-check pass. Full pytest -q: 3120 passed (pinned). Fresh check before this PR: the edited test fails on the unpatched module ("DID NOT RAISE ProviderError" for the 700 case; the 500 case passes) and passes at the head.

Codex: waived by the owner until the usage limits reset. CI: green at this head (run 41224850777: 2960 + 156 passed, 4 skipped; frontend gate 58 checks). Codacy 0 new issues, qlty pass, no open review threads.

Checklist

  • pytest -q passes (update SESSION_CONTEXT Section 1 if test count changed)
  • pre-commit run --all-files passes (all hooks)
  • python scripts/doc_state_sync.py --check exits 0
  • PLAYBOOK Section 3 reflects current WP/task state
  • PLAYBOOK Section 4 has a dated log entry:
    - Batch WP: inside DOCSYNC:CURRENT-BATCH-START/END markers
    - Side task: after DOCSYNC:CURRENT-BATCH-END marker
  • Changes are within scope of the active batch definition
    (or deviation is logged in the Section 4 entry)

Deezer's documented error table lists code 700 as SERVICE_BUSY. A 200
body carrying it was a terminal miss, so an outage was recorded as "no
match" for the album. It is now retried like an HTTP 5xx and, once the
retries are spent, raised as deezer_unavailable. The existing 5xx test
is parametrized to cover the code 700 body. Closes F-B23-37.

The patch was written by an outside agent (DeepSeek) and approved by an
independent typed review.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@pterw
pterw marked this pull request as ready for review October 31, 2026 17:38
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T17:38:50.403943Z
We couldn’t complete this review. Comment @codex review to try again.
47bf996 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@pterw
pterw merged commit f393c82 into main Oct 31, 2026
3 checks passed

@graphify-labs graphify-labs Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify reviewed this change.

No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.

Not checked: tests were not run; formal verification proved 0 of 2 changed function(s) (2 not verified).

Formal verification. PR-changed functions: 0/2 verified (0 proven, 0 may-equivalent, 0 distinguished) · 2 not verified (2 vacuous).

Not verified on this run: \_deezer\_request (vacuous: never exercised), search\_deezer\_album (vacuous: never exercised).


Graphify review — findings

Fixes Deezer treating a "service busy" reply as "no match": an HTTP 200 body carrying error code 700 (SERVICE_BUSY in Deezer's documented error table) is now retried like a 5xx, so after the retries run out the caller gets deezer_unavailable instead of a recorded miss. The existing exhausted-retries test is parametrized over the HTTP 500 and HTTP 200/code 700 cases and renamed to test_deezer_search_refused_on_every_attempt_raises_unavailable_not_no_match. Bookkeeping closes F-B23-37 and moves it to the findings archive. It also logs the side task in the PLAYBOOK, marks the archive pagination task as merged (PR #284), and bumps the pinned test count from 3119 to 3120.

No blocking issues surfaced.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 164 functions depend on the 164 functions this change touches.

Health — grade B; 3 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):

  • search_deezer_album() — 13 callers, 4 callees (high)
  • fetch_deezer_album() — 12 callers, 4 callees (high)
  • test_deezer_http_403_raises_unavailable_not_no_match() — 0 callers, 6 callees (medium)

Verification — 164 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 164 function(s) in the blast radius were not formally verified this run

Formal verification

Could not verify: Could not verify \_deezer\_request.

The verifier did not have enough to check \_deezer\_request, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 95 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous

Could not verify: Could not verify search\_deezer\_album.

The verifier did not have enough to check search\_deezer\_album, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 95 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous

@pterw pterw mentioned this pull request Oct 31, 2026
6 tasks done
@pterw
pterw deleted the fix/deezer-service-busy branch October 31, 2026 20:10
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