fix(admin): surface API error message in assign role toast#1644
Conversation
The Assign Role dialog was swallowing the server's error and only showing a generic "Failed to assign role" toast. When the API rejects the request (e.g. last owner cannot change role), the user couldn't see why. Forward the server's rawMessage into the toast description. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughTwo role-assignment files are updated to enhance error reporting: ChangesEnhanced error toast messaging on role assignment
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Coverage Report for CI Build 26273828643Coverage remained the same at 42.592%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
The Assign Role dialog catch blocks were swallowing the server's error and showing only a generic "Failed to assign role" toast. The actual reason (e.g. `last member cannot change role`) was never visible to the user.
Forwards `ConnectError.rawMessage` into the toast `description` field for both the org-level and project-level Assign Role dialogs. Falls back to no description for non-`ConnectError` errors → toast behavior is unchanged for those.
Affected paths:
web/sdk/admin/components/AssignRole.tsxpaths:
/workspaces/{orgId}/members→ row action menu on a member → "Assign role…"/users/{userId}→ side panel → membership row → role dropdown → "Assign role…"web/sdk/admin/views/organizations/details/projects/members/assign-role.tsx
Paths:
/workspaces/{orgId}/projects→ click a project row (opens the Project Members dialog) → row action menu on a member → "Assign role…"