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
{{ message }}
Repository navigation
Sync and async clients use different keep-alive settings #241
Only the async client overrides the connection pool limits. It sets httpx.Limits(keepalive_expiry=None) in swgoh_comlink_async.py, so idle pooled connections are kept forever. The sync client uses the httpx default, which closes them after 5 s idle. The git history (db474a4) gives no reason for the difference.
When an idle connection has been closed on the other side, by a Comlink restart or a NAT/router idle timeout, the next request on it can fail with httpx.RemoteProtocolError. _send raises that at once as a transport error, with no retry.
Reproduced on develop (9cc3760): the sync client gives 5.0, the async client gives None.
Suggested Fix
Remove the async override, so both clients use the httpx default limits (5 s idle keep-alive).
Add an optional keyword-only limits: httpx.Limits | None = None to both constructors for callers who need something else.
Leave request timeouts unchanged. /data keeps its longer GAME_DATA_TIMEOUT.
Acceptance
Both clients build their httpx clients with identical limits.
A unit test asserts that sync and async pass the same limits to httpx.
A docs/migration.md entry for the async keep-alive change.
If stale-connection failures continue after this change, retrying transport errors gets its own issue. That would change the documented retry contract (only 429, 503 and rate refusals are retried today).
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.