fix(server): re-throw StorageCapacityExhaustedError in POST /identities route catch block - #73
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe identity creation route now preserves storage capacity exhaustion errors so they produce a retryable 503 response. Regression coverage verifies the error body and response headers. The server package version increases from ChangesIdentity capacity errors
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…es catch block The identities route's own catch block was swallowing StorageCapacityExhaustedError and returning 500 identity_create_failed. app.onError correctly maps it to 503 via storageCapacityResponse, but it never saw the error because the route caught it first. Fix: check isStorageCapacityExhausted before the StorageOverloadedError handler and re-throw so app.onError's capacity mapper handles it correctly. Bumps @relayauth/server to 0.2.24. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a14eb35 to
75bd2a9
Compare
Summary
POST /identitiesroute catch block was swallowingStorageCapacityExhaustedError— returning 500 instead of 503app.onErrorcorrectly maps it to 503 viastorageCapacityResponse, but never saw it because the route's own catch block handled it firstisStorageCapacityExhausted(error)check beforeisStorageOverloadedErrorand re-throw forapp.onErrorto handle@relayauth/serverto 0.2.24create-identity.test.tsasserting 503 +storage_capacity_exhaustedenvelopeWhy this matters
Cloud's
PostAuthMintCapacityDOgate throwsStorageCapacityExhaustedErrorfromstorage.identities.create()when the mint window is exhausted. Without this fix, the 503 envelope never reaches the caller — they see a generic 500identity_create_failedinstead of a retryable capacity error.Cloud PR #2901 (durable post-auth global mint-capacity admission gate) depends on this upstream fix.
Test plan
POST /v1/identities returns 503 with capacity envelope when storage.identities.create throws StorageCapacityExhaustedError(new test)🤖 Generated with Claude Code