Http.Error Timeout variant without configurable timeout in Elm 0.19
0 reputation · 04 Oct 2020, 21:04 UTC
Http.Error Timeout without configurable duration
The core Http.Error type includes a Timeout variant, but Http.request accepts no timeout parameter, so developers must implement application‑level deadlines manually.
Typical patterns race Http.request against Process.sleep using Task and then filter messages with a request identifier to ignore late‑arriving successes.
Because the Elm runtime cannot abort the underlying browser request, a race condition may deliver both a success message and a timeout message for the same request, requiring defensive ignore logic and increasing update complexity.
What mechanisms can ensure that a timeout yields a single, final state transition for a given request without wasting bandwidth or leaking timers?