@oh-my-pi/pi-utils 17.3.1 → 17.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.3.2] - 2026-08-13
6
+
7
+ ### Fixed
8
+
9
+ - Fixed `fetchWithRetry()` aborts during retry backoff to preserve the documented `"Request was aborted"` error contract ([#8450](https://github.com/can1357/oh-my-pi/issues/8450)).
10
+
5
11
  ## [17.3.0] - 2026-08-13
6
12
 
7
13
  ### Fixed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "17.3.1",
4
+ "version": "17.3.3",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-natives": "17.3.1"
34
+ "@oh-my-pi/pi-natives": "17.3.3"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/bun": "^1.3.14"
@@ -220,7 +220,7 @@ export async function fetchWithRetry(
220
220
  if (signal?.aborted) throw new Error("Request was aborted");
221
221
  const wrapped = wrapNetworkError(error);
222
222
  if (attempt + 1 >= maxAttempts) throw wrapped;
223
- await scheduler.wait(resolveDefaultDelay(defaultDelayMs, attempt, maxDelayMs), { signal });
223
+ await waitForRetry(resolveDefaultDelay(defaultDelayMs, attempt, maxDelayMs), signal);
224
224
  continue;
225
225
  }
226
226
 
@@ -234,7 +234,7 @@ export async function fetchWithRetry(
234
234
  if (hint !== undefined && hint > maxDelayMs) return response;
235
235
 
236
236
  const delayMs = Math.min(hint ?? resolveDefaultDelay(defaultDelayMs, attempt, maxDelayMs), maxDelayMs);
237
- await scheduler.wait(delayMs, { signal });
237
+ await waitForRetry(delayMs, signal);
238
238
  }
239
239
  }
240
240
 
@@ -251,6 +251,15 @@ function mergeInit(base: RequestInit, overlay: RequestInit, timeout: number | fa
251
251
  return merged;
252
252
  }
253
253
 
254
+ async function waitForRetry(delayMs: number, signal: AbortSignal | undefined): Promise<void> {
255
+ try {
256
+ await scheduler.wait(delayMs, { signal });
257
+ } catch (error) {
258
+ if (signal?.aborted) throw new Error("Request was aborted");
259
+ throw error;
260
+ }
261
+ }
262
+
254
263
  function wrapNetworkError(error: unknown): Error {
255
264
  if (error instanceof Error) {
256
265
  if (error.name === "AbortError" || error.message === "Request was aborted") {