@supabase/postgrest-js 2.117.2 → 2.117.3-canary.0
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/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/fetchWithRetry.ts +12 -3
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/fetchWithRetry.ts
CHANGED
|
@@ -70,7 +70,8 @@ export interface RetryableRequest {
|
|
|
70
70
|
* `DEFAULT_MAX_RETRIES` times when the fetch rejects or the server answers
|
|
71
71
|
* with a retryable status (503, 520). The wait honours the `Retry-After`
|
|
72
72
|
* header when present and backs off exponentially otherwise. Retried
|
|
73
|
-
* attempts carry an `X-Retry-Count` header. Aborted requests
|
|
73
|
+
* attempts carry an `X-Retry-Count` header. Aborted requests (including
|
|
74
|
+
* `AbortSignal.timeout()`, which rejects with `TimeoutError`) and
|
|
74
75
|
* non-idempotent methods are never retried: their rejection propagates
|
|
75
76
|
* unchanged. A response body is drained before its request is retried.
|
|
76
77
|
*/
|
|
@@ -101,8 +102,16 @@ export async function fetchWithRetry(
|
|
|
101
102
|
// is too narrow here; narrow at the use site with optional chaining.
|
|
102
103
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
104
|
} catch (fetchError: any) {
|
|
104
|
-
// Never retry aborted requests
|
|
105
|
-
|
|
105
|
+
// Never retry aborted requests. `AbortSignal.timeout()` rejects with
|
|
106
|
+
// `TimeoutError` rather than `AbortError`, so it needs its own check.
|
|
107
|
+
// Gated on `request.signal?.aborted` because `TimeoutError`, unlike
|
|
108
|
+
// `AbortError`, isn't exclusive to aborts: a custom fetch implementation
|
|
109
|
+
// may throw it for an unrelated, retryable timeout of its own.
|
|
110
|
+
if (
|
|
111
|
+
fetchError?.name === 'AbortError' ||
|
|
112
|
+
fetchError?.code === 'ABORT_ERR' ||
|
|
113
|
+
(fetchError?.name === 'TimeoutError' && request.signal?.aborted)
|
|
114
|
+
) {
|
|
106
115
|
throw fetchError
|
|
107
116
|
}
|
|
108
117
|
|
package/src/version.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// - Debugging and support (identifying which version is running)
|
|
5
5
|
// - Telemetry and logging (version reporting in errors/analytics)
|
|
6
6
|
// - Ensuring build artifacts match the published package version
|
|
7
|
-
export const version = '2.117.
|
|
7
|
+
export const version = '2.117.3-canary.0'
|