fix(backend): expose externalAccountId on ExternalAccount resource#8995
Conversation
🦋 Changeset detectedLatest commit: 8f9546d The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Repository UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthrough
ChangesExternal account ID mapping
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
API Changes Report
Summary
🔴 Breaking changes index (5)Every breaking change, up front. Full diffs are in the package sections below.
@clerk/sharedVersion: 4.22.0 → 4.21.0 Subpath
|
Co-authored-by: VihaanAgarwal <vihaan@clique.so>
afef28f to
8f9546d
Compare
|
Building on @VihaanAgarwal's original fix in #8982. Added him as co-author on the squash. |
The backend
ExternalAccount.idis theidn_identification id for Google and Facebook accounts, so handing it tousers.deleteUserExternalAccount()(which wants theeac_id) returns a 404. This adds an optionalexternalAccountIdthat carries theeac_value.The part worth knowing is why it's optional. The Backend API only returns
external_account_idfor Google and Facebook accounts, whereidis theidn_value. Every other provider already returnsidas theeac_id and noexternal_account_id. So the deletable id isexternalAccountId ?? id, neverexternalAccountIdon its own, and the JSDoc plus changeset say as much. ThegetUserfixture now carries both agoogle_accountand a genericexternal_accountentry so the test asserts both shapes.This is an alternative to #8982, which mapped the same field but typed it as a required string and pointed callers at
externalAccountIddirectly, which would 404 for every non-Google/Facebook account.Fixes #7936
Fixes #7584
Summary by CodeRabbit
Bug Fixes
Tests