fix(repo): guard empty error lists in the integration role helper - #9939
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: f9ecc71 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughThe role-permission assignment catch now rethrows non-Clerk errors and Clerk API errors with a missing or non-matching first error code. It continues to ignore the existing-association error. An empty-frontmatter Changesets file was added. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The helper now surfaces unexpected failures while retaining duplicate-association handling, and the added no-release changeset is accepted by the repository workflow. No merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
dstaley
left a comment
There was a problem hiding this comment.
might be clearer to rework this into two separate conditions
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Description
bulkCreateFeaturesPermissionsRolestolerates the Backend API rejecting a permission assignment that already exists by readingerr.errors[0].codeinside itscatch. When the API returns aClerkAPIResponseErrorwhoseerrorsarray is empty, that read throws aTypeErrorfrom inside thecatch, replacing the real API error and repeating for every permission in the loop until the run aborts withNo tests found. The same guard also only rethrewClerkAPIResponseErrorinstances, so any other rejection (a network failure, or an error the retry wrapper gave up on) was swallowed and the loop carried on as if the permission had been assigned.This guards the read with optional chaining and inverts the condition so the helper only ignores the existing-association error. Anything else, including an API error with no entries, is rethrown as itself and the original failure is what surfaces in the CI log.
Seen on the
Integration Tests (tanstack-react-start, chrome)job of #9783 (run 36161445397), where the underlying failure was a transient Backend API error unrelated to the PR under test.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
🤖 Generated with Claude Code