You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
configuration.WithRetry documents that each domain client defines which requests qualify for automatic retries. The database module retries idempotent reads with backoff and Retry-After support. The auth module currently retries nothing, documented as such, since verification calls sit on request-handling hot paths and retrying the JWK Set fetch or GetUser fallback multiplies both caller latency and Auth-server traffic.
Decide whether auth should honour the option on its idempotent GETs (which means lifting the retry transport from postgrest/internal/http into shared internals) or whether the option should be explicitly scoped to the database module in its own documentation. Either outcome should land with docs making the scope obvious to a consumer setting the option on a shared configuration.
The capability matrix now has a spec for this contract on the database side: database.configuration.auto_retry, in review in supabase/sdk#190. It does not settle the auth scope question in this issue. It does list four points where postgrest/internal/exchange/exchange.go differs from the spec:
No jitter. The wait is time.Second << attempt. The spec: full jitter, a random wait in [0, min(30 s, 1 s × 2^(n−1))], a new value for each wait.
Retry-After has no cap.Retry-After: 3600 makes the request wait one hour. The spec: a value over 30 s ends the retries, and that response is the outcome.
Retry-After as an HTTP-date is not read. It falls back to the backoff, which is safe, but the spec reads both delta-seconds and HTTP-date.
Retry-After: 0 retries at once. The spec: 0, or a date that has passed, falls back to the jittered wait.
The rest already matches: GET/HEAD only, 503/520, 4 attempts in total, X-Retry-Count, the per-client switch and the per-read override in both directions, cancellation, and no retry of token-callback errors. The 401 re-send that shares the attempt budget is allowed by the access-token spec.
There is no Storage module, so storage.configuration.auto_retry does not apply.
Thanks @grdsdev, all four hold against main at 668e1e5. I'll wait for supabase/sdk#190 to merge before working on them, with one exception: Retry-After: 0, which I'll pick up now as a quick win.
A fifth difference. Cancellation doesn't fully match: when an attempt fails with a network error and the caller's context ends during the wait that follows, the call returns the network error rather than the cancellation (exchange.go L171-L178). I'll fix it with the rest.
Written with assistance from my friend, and yours, 🤖 Claude.
Spider Claude. Spider Claude.
Does whatever a Spider Claude does.
Can it swing from a web? No it can't. It's an AI. 🐷
Activity
grdsdev commentedon Nov 26, 2026
The capability matrix now has a spec for this contract on the database side: database.configuration.auto_retry, in review in supabase/sdk#190. It does not settle the auth scope question in this issue. It does list four points where
postgrest/internal/exchange/exchange.godiffers from the spec:time.Second << attempt. The spec: full jitter, a random wait in[0, min(30 s, 1 s × 2^(n−1))], a new value for each wait.Retry-Afterhas no cap.Retry-After: 3600makes the request wait one hour. The spec: a value over 30 s ends the retries, and that response is the outcome.Retry-Afteras an HTTP-date is not read. It falls back to the backoff, which is safe, but the spec reads both delta-seconds and HTTP-date.Retry-After: 0retries at once. The spec: 0, or a date that has passed, falls back to the jittered wait.The rest already matches:
GET/HEADonly,503/520, 4 attempts in total,X-Retry-Count, the per-client switch and the per-read override in both directions, cancellation, and no retry of token-callback errors. The 401 re-send that shares the attempt budget is allowed by the access-token spec.There is no Storage module, so
storage.configuration.auto_retrydoes not apply.QuintinWillison commentedon Nov 26, 2026
Thanks @grdsdev, all four hold against
mainat 668e1e5. I'll wait for supabase/sdk#190 to merge before working on them, with one exception:Retry-After: 0, which I'll pick up now as a quick win.Two notes for you, no action needed:
Retry-After: 0is the common case, not an edge case. Since v12.2.2, every 503 from the PostgREST server carries it, because PostgREST/postgrest@f09655b stopped updating the value. So today this SDK retries a read that gets a 503 three times with no wait, which is why I'm not waiting on this one. It also backs the0rule in docs(capability-matrix): add specs for database and storage auto_retry sdk#190.exchange.goL171-L178). I'll fix it with the rest.Written with assistance from my friend, and yours, 🤖 Claude.
Spider Claude. Spider Claude.
Does whatever a Spider Claude does.
Can it swing from a web? No it can't. It's an AI. 🐷