Skip to content

fix(web): apply the client request timeout instead of dropping it - #722

Merged
Makisuo merged 1 commit into
fix/01-digest-opt-out-and-sweep-cadencefrom
fix/02-web-client-request-timeout
Sep 1, 2026
Merged

fix(web): apply the client request timeout instead of dropping it#722
Makisuo merged 1 commit into
fix/01-digest-opt-out-and-sweep-cadencefrom
fix/02-web-client-request-timeout

Conversation

@Makisuo

@Makisuo Makisuo commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Second of a five-PR stack, based on #721.

mapleFetch passed init?.signal ?? AbortSignal.timeout(CLIENT_TIMEOUT_MS). Effect's FetchHttpClient supplies its own signal on every request — the fiber's interrupt — so init.signal was always set and the 45-second timeout never applied. A stalled API or warehouse request stayed pending indefinitely, holding the query that issued it.

The deadline moves to the client layer as Effect.timeoutOrElse, rather than being repaired in place by composing two abort signals. A deadline the fetch implementation holds is the wrong shape: timing out the fiber is what aborts the in-flight request, so there is one deadline enforced by the runtime instead of a second signal raced against the runtime's own. It fails as an HttpClientError carrying a TransportError, which is what consumers already handle.

mapleFetch reads an abort as evidence of nothing, which is right for an interrupt and wrong for a deadline, so the timeout marks the origin unreachable itself.

Server-side warehouse attempts are already capped well below 45s, so nothing legitimate runs into this.

Tests

http-client.test.ts drives the real client over a stub FetchHttpClient.Fetch on the TestClock: still pending at 44s, failed with an HttpClientError at 45s, and a responding request untouched.

`mapleFetch` passed `init?.signal ?? AbortSignal.timeout(CLIENT_TIMEOUT_MS)`,
but Effect's `FetchHttpClient` supplies its own signal on every request — the
fiber's interrupt — so `init.signal` was always set and the 45-second timeout
never applied. A stalled API or warehouse request stayed pending indefinitely,
holding the query that issued it.

The deadline moves to the client layer as `Effect.timeoutOrElse`, rather than
being repaired in place by composing two abort signals. A deadline the fetch
implementation holds is the wrong shape: timing out the fiber is what aborts the
in-flight request, so there is one deadline enforced by the runtime instead of a
second signal raced against the runtime's own. It fails as an `HttpClientError`
carrying a `TransportError`, which is what consumers already handle.

`mapleFetch` reads an abort as evidence of nothing, which is right for an
interrupt and wrong for a deadline, so the timeout marks the origin unreachable
itself.
@Makisuo
Makisuo force-pushed the fix/02-web-client-request-timeout branch from f05d95f to 64c0330 Compare September 1, 2026 14:51
@Makisuo
Makisuo merged commit f2c5d9f into main Sep 1, 2026
33 checks passed
@Makisuo
Makisuo deleted the fix/02-web-client-request-timeout branch September 1, 2026 15:33
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🍁 Maple PR preview

Warning

Preview cleanup could not be confirmed. The Alchemy teardown outcome was skipped.

Final commit 64c0330 · View workflow run

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