• 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
名称
最后提交
最后更新
..
ai_messages_utils.ts 正在载入提交数据...
app_env_var_utils.ts 正在载入提交数据...
cleanFullResponse.ts 正在载入提交数据...
context_paths_utils.ts 正在载入提交数据...
debug_fetch.ts 正在载入提交数据...
dyad_tag_parser.ts 正在载入提交数据...
fallback_ai_model.ts 正在载入提交数据...
file_uploads_state.ts 正在载入提交数据...
file_utils.ts 正在载入提交数据...
findLanguageModel.ts 正在载入提交数据...
get_model_client.ts 正在载入提交数据...
git_author.ts 正在载入提交数据...
git_utils.ts 正在载入提交数据...
llm_engine_provider.ts 正在载入提交数据...
lm_studio_utils.ts 正在载入提交数据...
lock_utils.ts 正在载入提交数据...
mcp_consent.ts 正在载入提交数据...
mcp_manager.ts 正在载入提交数据...
mcp_tool_utils.ts 正在载入提交数据...
mention_apps.ts 正在载入提交数据...
neon_timestamp_utils.ts 正在载入提交数据...
ollama_provider.ts 正在载入提交数据...
path_utils.ts 正在载入提交数据...
port_utils.ts 正在载入提交数据...
process_manager.ts 正在载入提交数据...
provider_options.ts 正在载入提交数据...
read_env.ts 正在载入提交数据...
replacePromptReference.ts 正在载入提交数据...
retryOnLocked.ts 正在载入提交数据...
retryWithRateLimit.ts 正在载入提交数据...
runShellCommand.ts 正在载入提交数据...
safe_sender.ts 正在载入提交数据...
simpleSpawn.ts 正在载入提交数据...
start_proxy_server.ts 正在载入提交数据...
telemetry.ts 正在载入提交数据...
template_utils.ts 正在载入提交数据...
test_utils.ts 正在载入提交数据...
thinking_utils.ts 正在载入提交数据...
token_utils.ts 正在载入提交数据...
vercel_utils.ts 正在载入提交数据...
versioned_codebase_context.ts 正在载入提交数据...