You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cancellation in the pacing loop: the sync client catches BaseException while the async one catches asyncio.CancelledError.
Docstrings differ.
The retry and pacing loop in _request is the hardest part to keep identical, and it is fully duplicated.
Proposed Solution
Move the decision logic out of _request into _base.py or retry.py, with no I/O:
Preparing a request: body, headers, and which httpx client to use.
Interpreting a response: turning an httpx.Response into a result or an exception.
The retry step: given an error and the attempt number, return the delay and whether a rate hold applies.
Each client keeps only a short loop that sends, sleeps, and handles cancellation for its runtime. Add a test that every public method on SwgohComlinkAsync exists on SwgohComlink with the same signature, aliases included.
Acceptance
_request in each client is under 40 lines and contains no retry decisions.
test_retry.py, test_retry_mocked.py, test_rate_hold_admission.py and test_pacer_scaling.py pass unchanged.
The method-signature parity test passes.
Alternatives Considered
Generate the sync client from the async one (unasync or a script), with a CI check. Deferred: it adds a dev dependency and a code-generation step. It can be revisited after this lands.
Activity
github-actions commentedon Nov 7, 2026
Addressed by #258, which is now merged into
develop. This issue will close automatically when that change is released tomain.