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
AsyncManagementClient with custom_domain fails every request with TypeError #906
When you create AsyncManagementClient with custom_domain, every request raises:
TypeError: object NoneType can't be used in 'await' expression
AsyncManagementClient.__init__ adds _enforce_custom_domain_whitelist to the request event hooks of an httpx.AsyncClient. That function is synchronous. httpx.AsyncClient awaits each request hook (await hook(request)), so awaiting the None it returns raises TypeError before the request is sent. The sync ManagementClient is not affected.
Reproduced on current master (301b861, v6.11.0, Python 3.12.3, httpx 0.29.0): the reporter's repro still fails with TypeError: object NoneType can't be used in 'await' expression at await hook(request) in httpx's async client, while the sync ManagementClient with the same custom_domain succeeds.
I verified the fix independently on this master: with an async wrapper hook registered on the async client (the approach in #907; sync hook untouched), the repro passes, and the header is kept on /api/v2/users/{id} and stripped on /api/v2/connections/{id}. I also ran the existing TestCustomDomainHeader + client-init unit-test selection with and without the change: identical results (same pre-existing failures either way, no new failures from the fix). The bug is still present on master and #907 resolves it.
Activity
ToniAdreal commentedon Nov 27, 2026
Reproduced on current master (301b861, v6.11.0, Python 3.12.3, httpx 0.29.0): the reporter's repro still fails with
TypeError: object NoneType can't be used in 'await' expressionatawait hook(request)in httpx's async client, while the syncManagementClientwith the samecustom_domainsucceeds.I verified the fix independently on this master: with an async wrapper hook registered on the async client (the approach in #907; sync hook untouched), the repro passes, and the header is kept on
/api/v2/users/{id}and stripped on/api/v2/connections/{id}. I also ran the existingTestCustomDomainHeader+ client-init unit-test selection with and without the change: identical results (same pre-existing failures either way, no new failures from the fix). The bug is still present on master and #907 resolves it.