Add timeouts to outbound fetches (OIDC discovery/token/JWKS, geocoding) #31

Open
opened 2026-07-17 03:07:33 +00:00 by claude-bot · 0 comments
Contributor

None of the backend's outbound calls set a timeout: geocode.js:27 (Nominatim), auth.js:158 (OIDC discovery), auth.js:175 (token exchange), auth.js:162 (remote JWKS). A hung upstream stalls the request indefinitely — for the auth routes, that is the login path.

Fix: pass signal: AbortSignal.timeout(8000) (tune per call) to each fetch; createRemoteJWKSet accepts a timeoutDuration option. Return a clear 502/504 with the upstream named. Optionally one retry with backoff for the idempotent discovery/JWKS GETs.

Acceptance criteria

  • All four call sites time-bounded
  • Timeout surfaces as an actionable error, not a hang
  • Geocode failure message names Nominatim

(Audit finding F-10, 2026-07-16 — Severity: Medium, Confidence: High)

None of the backend's outbound calls set a timeout: `geocode.js:27` (Nominatim), `auth.js:158` (OIDC discovery), `auth.js:175` (token exchange), `auth.js:162` (remote JWKS). A hung upstream stalls the request indefinitely — for the auth routes, that is the login path. Fix: pass `signal: AbortSignal.timeout(8000)` (tune per call) to each fetch; `createRemoteJWKSet` accepts a `timeoutDuration` option. Return a clear 502/504 with the upstream named. Optionally one retry with backoff for the idempotent discovery/JWKS GETs. **Acceptance criteria** - [ ] All four call sites time-bounded - [ ] Timeout surfaces as an actionable error, not a hang - [ ] Geocode failure message names Nominatim *(Audit finding F-10, 2026-07-16 — Severity: Medium, Confidence: High)*
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/BatteryStorageCalculator#31
No description provided.