Raise ApiClient default timeout to 30s
The upstream /schedule endpoint regularly returns 7MB+ payloads and takes 6-10s to complete. The 5s default was aborting those fetches mid-body, cascading into a retry loop that showed ERR_ABORTED in DevTools and 'Failed to load data' on the UI — even though the backend eventually answered with HTTP 200. Matches Angular's default.
This commit is contained in:
@@ -36,7 +36,11 @@ export class ApiClient {
|
||||
this.locale = options.locale;
|
||||
this.traceId = options.traceId;
|
||||
this.fetchFn = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
||||
this.timeoutMs = options.defaultTimeoutMs ?? 5000;
|
||||
// Upstream schedule endpoint regularly returns 7MB+ payloads over
|
||||
// a slow WAF-protected connection and can take 8–10 seconds in
|
||||
// dev. 5s was far too aggressive — the fetch would abort mid-body
|
||||
// and cascade into retry loops. 30s matches Angular's default.
|
||||
this.timeoutMs = options.defaultTimeoutMs ?? 30_000;
|
||||
this.maxRetries = options.retry?.maxRetries ?? 3;
|
||||
this.timeoutFactor = options.retry?.timeoutFactor ?? 2;
|
||||
this.retryStatusCodes = new Set(
|
||||
|
||||
Reference in New Issue
Block a user