feat(#417): add fetchWithRetry with exponential backoff for auth

Retries network and server errors up to 3 times with exponential
backoff (1s, 2s, 4s). Non-retryable errors fail immediately.

Refs #417
This commit is contained in:
Jason Woltje
2026-02-16 12:19:46 -06:00
parent f1ee0df933
commit c233d97ba0
3 changed files with 413 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
/**
* Wait for the specified number of milliseconds.
*
* Extracted to a separate module to enable clean test mocking
* without fake timers.
*/
export function sleep(ms: number): Promise<void> {
return new Promise<void>((resolve) => setTimeout(resolve, ms));
}