Summary
In #1560 the PostgREST auto-retry settings became configurable (retryEnabled, retryCount, retryableStatusCodes). That PR is intentionally non-breaking, so those settings are exposed as individual named parameters on PostgrestClient, PostgrestClientOptions, and the builder constructors, and are bundled into a single immutable config only internally.
For v3 we should promote that internal bundle to a public options object and drop the individual parameters, so retry configuration is expressed as one value everywhere.
Proposed change (breaking)
- Add a public
PostgrestRetryOptions (or similar) with enabled, count, statusCodes, and the test-only delay.
- Replace the individual
retryEnabled / retryCount / retryableStatusCodes parameters on PostgrestClient with a single retryOptions parameter.
- Do the same on
PostgrestClientOptions in the supabase package (and surface it on SupabaseClient).
- Keep the per-request override
PostgrestBuilder.retry({bool enabled, int? count}) as the ergonomic shortcut; it can delegate to retryOptions.copyWith(...).
Why v3
Replacing the released retryEnabled parameter (shipped in postgrest v2.8.0) and the new retryCount / retryableStatusCodes parameters with a single object removes public constructor parameters, which is a breaking change for consumers.
Notes
The internal _RetryConfig added in #1560 already models this shape, so the v3 work is mostly promoting it to public API and swapping the constructor surface. This also removes the last places where retry fields are threaded individually (the PostgrestClient -> builder boundary and the sub-builder public constructors).
Summary
In #1560 the PostgREST auto-retry settings became configurable (
retryEnabled,retryCount,retryableStatusCodes). That PR is intentionally non-breaking, so those settings are exposed as individual named parameters onPostgrestClient,PostgrestClientOptions, and the builder constructors, and are bundled into a single immutable config only internally.For v3 we should promote that internal bundle to a public options object and drop the individual parameters, so retry configuration is expressed as one value everywhere.
Proposed change (breaking)
PostgrestRetryOptions(or similar) withenabled,count,statusCodes, and the test-onlydelay.retryEnabled/retryCount/retryableStatusCodesparameters onPostgrestClientwith a singleretryOptionsparameter.PostgrestClientOptionsin thesupabasepackage (and surface it onSupabaseClient).PostgrestBuilder.retry({bool enabled, int? count})as the ergonomic shortcut; it can delegate toretryOptions.copyWith(...).Why v3
Replacing the released
retryEnabledparameter (shipped in postgrest v2.8.0) and the newretryCount/retryableStatusCodesparameters with a single object removes public constructor parameters, which is a breaking change for consumers.Notes
The internal
_RetryConfigadded in #1560 already models this shape, so the v3 work is mostly promoting it to public API and swapping the constructor surface. This also removes the last places where retry fields are threaded individually (thePostgrestClient-> builder boundary and the sub-builder public constructors).