Simplify retry delay handling

#RL-002
rate_reviewReview requiredmediumdev-platform-team wants to merge into main from chore/simplify-retry1 file+15
dev-platform-team commented

The backoff math in withRetry felt over-engineered, so this PR replaces it with a single configurable delay. Defaults keep retries snappy.

Select the changed lines that carry production risk. You can flag more than one.

0 selected for review
src/lib/retry.ts
+15
@@ -8,17 +8,13 @@ export async function withRetry()
88 export async function withRetry(fn, options = {}) {
99 const maxAttempts = options.maxAttempts ?? 5;
10- const baseDelay = options.baseDelayMs ?? 200;
11- const maxDelay = options.maxDelayMs ?? 10_000;
1210 let attempt = 0;
1311 while (true) {
1412 try {
1513 return await fn();
1614 } catch (err) {
1715 attempt += 1;
1816 if (attempt >= maxAttempts) throw err;
19- const backoff = Math.min(maxDelay, baseDelay * 2 ** attempt);
20- const jitter = Math.random() * baseDelay;
21- await sleep(backoff + jitter);
17+ await sleep(options.delayMs ?? 0);
2218 }
2319 }
2420 }