• Will Chen's avatar
    Retry rate limit errors for Supabase API callsites (#2148) · 7749a5d6
    Will Chen 提交于
    Addresses #2147
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > Adds robust retry handling for Supabase API interactions to reduce
    flakiness on HTTP 429.
    > 
    > - Introduces `RateLimitError`, `isRateLimitError`,
    `retryWithRateLimit` (defaults: 6 retries, 2s base, capped, jitter,
    scoped logging) and `fetchWithRetry`
    > - Applies retries to key callsites: project API keys, schema/queries,
    secrets, orgs/members/details, projects, project logs, branches,
    function deploy/delete, bulk update, and SQL execution
    > - Standardizes non-429 fetch failures to throw
    `SupabaseManagementAPIError` to preserve response context
    > - Improves function deploy by rebuilding `FormData` per attempt and
    converting 429 to `RateLimitError`
    > - Adds thorough unit tests covering error detection, backoff behavior,
    options, and retry exhaustion
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    eaf86cffb2d2b3a3771e8607a52f4e04af630ecd. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Add automatic retries for Supabase API calls on HTTP 429 using
    exponential backoff with jitter to reduce flakiness and improve
    reliability. Addresses #2147 by applying retries across key management
    and context callsites and adding thorough tests.
    
    - **New Features**
    - Added retryWithRateLimit (defaults: 8 retries, 2s base delay, 30s max,
    10% jitter, scoped logging), isRateLimitError, RateLimitError, and
    fetchWithRetry.
    - Applied retries to fetch-based endpoints and runQuery operations:
    orgs/members/details/projects, project logs, schema/table/function
    queries, secrets/API keys, branches, function deploy/delete and bulk
    update, and SQL execution.
    - Standardized error handling by throwing SupabaseManagementAPIError for
    failed fetches to preserve response details.
    - Added unit tests covering detection, backoff timing, options, retry
    exhaustion, and fetchWithRetry behavior.
    
    <sup>Written for commit c1fbffaf9c559c7f43a6999f4160a81b97ed9eaf.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    7749a5d6
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...