Skip to content

Seclai(timeout=...) is ignored by methods built on request() when an http_client is supplied #17

Open

Description

@burgaard

Seclai(timeout=...) is not applied consistently: about 164 public methods on Seclai (and their AsyncSeclai twins) ignore it when the client was given an http_client, while the typed methods honour it. Two methods on the same client can therefore time out differently, and which one a caller gets depends on how the method is implemented internally.

Reproduced on main (1.7.2) with a mock transport recording each request's timeout:

Client list_sources() (typed) a method built on Seclai.request(), e.g. add_email_domain()
Seclai(timeout=7.0, http_client=httpx.Client(timeout=3.0)) 7 s 3 s (the passed 7 s is ignored)
Seclai(http_client=httpx.Client(timeout=3.0)) no limit 3 s

Seclai.request() calls self._client.request(...) without a timeout, while the typed path's senders set timeout=self._options.explicit_timeout. The second row also contradicts the constructor docstring, which says a supplied http_client "keeps its own" timeout: the typed methods replace it with no limit.

Goal: one timeout rule for every public method, whichever internal path it uses, and a constructor docstring that states that rule. Whatever the rule is, a timeout passed to Seclai(...) should apply to every method.

Found while reviewing #16, where new methods built on request() inherit this.

Activity

  1. added theissue type on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions