fix: replace 500 error with bad request due to bitbucket returning 429#6872
fix: replace 500 error with bad request due to bitbucket returning 429#6872mathnogueira wants to merge 7 commits into
Conversation
|
💬 Discussion in Slack: #pr-review-infisical-6872-fix-replace-500-error-with-bad-request-due-to-bitbucket Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| backend/src/services/app-connection/bitbucket/bitbucket-connection-fns.ts | Adds ensureBitbucketRateLimitNotExceeded helper and wraps all four Bitbucket listing functions in try/catch to convert 429 AxiosErrors into user-friendly BadRequestErrors; logic is correct and consistently applied. |
Reviews (2): Last reviewed commit: "fix lint issues" | Re-trigger Greptile
|
@greptile review this again |
| } | ||
|
|
||
| return environments; | ||
| return paginateBitbucketRequest<TBitbucketEnvironment>( |
There was a problem hiding this comment.
environments don't support searching by a term, so it's the only endpoint we still need to run this logic.
Context
We had a customer complaining about bitbucket failing with 500 error. However, after investigation, it was failing because BitBucket was returning 429 errors.
We, unfortunately, cannot give more details because BitBucket doesn't return more information: for example, how long to wait. Bitbucket rate limit windows are 1h long.
Screenshots
Steps to verify the change
Type
Checklist
type(scope): short description(scope is optional, e.g.,fix: prevent crash on syncorfix(api): handle null response).