[help wanted] Add timeout support for provider requests
Summary
Add timeout support for outbound provider requests so one slow or hanging provider does not block Freeway indefinitely.
Background
Provider calls currently use fetch() without an explicit timeout. Free-tier providers can sometimes hang or respond very slowly, and Freeway should be able to fail fast and fall back to another provider.
Relevant files:
src/providers/base.tssrc/health.ts- possibly provider-specific adapters
Requirements
- [ ] Add an
AbortControllertimeout around providerfetch()calls. - [ ] Use a sensible default timeout, or support an env var such as
FREEWAY_PROVIDER_TIMEOUT_MS. - [ ] Ensure router fallback still works when a provider times out.
- [ ] Ensure health checks mark timed-out providers as unhealthy.
Acceptance Criteria
- [ ] A timed-out provider does not hang the whole request indefinitely.
- [ ] Timeout errors are clear enough for troubleshooting.
- [ ] Fallback behavior is preserved.
- [ ]
npm run buildpasses.
Notes for Contributors
Please keep the first PR focused on timeout behavior. Broader retry/circuit-breaker logic can be handled separately.
Hi! I’d like to help with this issue :))
It looks like a good contribution to understand how provider request handling works in the project. Could you please assign it to me?
Thanks!
Assigned to you @Flames4fun! Looking forward to your PR.