Skip to content

fix(sdk): use setOrganizationMemberRole RPC in update role dialog#1628

Merged
rohanchkrabrty merged 8 commits into
mainfrom
fix-member-update-role
May 20, 2026
Merged

fix(sdk): use setOrganizationMemberRole RPC in update role dialog#1628
rohanchkrabrty merged 8 commits into
mainfrom
fix-member-update-role

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Replace the legacy listPoliciesdeletePolicycreatePolicy sequence in the views-new update role dialog with a single setOrganizationMemberRole RPC call, matching the migration already done in the legacy views.
  • Drop now-unused schema imports and the Policy type from update-role-dialog.tsx.
  • Keep existing dialog UI, handleConnectError mapping, and toast behaviour unchanged.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment May 20, 2026 7:35am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8ee29207-598a-4116-9743-e49e40e0c880

📥 Commits

Reviewing files that changed from the base of the PR and between 339b867 and a23585e.

📒 Files selected for processing (2)
  • web/sdk/react/views-new/members/components/remove-member-dialog.tsx
  • web/sdk/react/views-new/members/components/update-role-dialog.tsx
💤 Files with no reviewable changes (1)
  • web/sdk/react/views-new/members/components/remove-member-dialog.tsx

📝 Walkthrough

Summary by CodeRabbit

Refactor

  • Enhanced member role update functionality for improved performance and reliability.

Walkthrough

This PR refactors the organization member role update flow from client-side policy management (query, delete, create) to a direct role-setting RPC call. It also removes an unused import from the remove-member dialog. The update-role dialog now uses setOrganizationMemberRole with the new schema, while preserving existing success/error handling, toasts, and dialog lifecycle.

Changes

Member Dialog Updates

Layer / File(s) Summary
Unused import removal
web/sdk/react/views-new/members/components/remove-member-dialog.tsx
The Flex component is removed from the @raystack/apsara-v1 imports.
Role update flow refactoring
web/sdk/react/views-new/members/components/update-role-dialog.tsx
The role update handler is refactored to call setOrganizationMemberRole directly instead of querying and managing policies. React/Connect imports are updated to remove useQuery and policy schemas, and add SetOrganizationMemberRoleRequestSchema. Success and error handling (toast, refetch, dialog close) remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • raystack/frontier#1610: Directly addresses the regression by replacing policy CRUD with setOrganizationMemberRole in update-role-dialog.
  • raystack/frontier#1459: The main change implements the proposal to use SetOrganizationMemberRole RPC instead of SDK-level policy manipulation.
  • raystack/frontier#1571: The role update uses the updated SetOrganizationMemberRole RPC with principal_type/principal_id support.

Possibly related PRs

  • raystack/frontier#1572: Parallels the same pattern of migrating from policy operations to direct membership API role-setting calls in service-account project access dialogs.
  • raystack/frontier#1497: Addresses the schema import by ensuring SetOrganizationMemberRoleRequestSchema is exported from @raystack/proton.
  • raystack/frontier#1477: Directly overlaps in refactoring the member role update flow to call SetOrganizationMemberRole RPC instead of policy CRUD.

Suggested reviewers

  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coveralls
Copy link
Copy Markdown

coveralls commented May 19, 2026

Coverage Report for CI Build 26148345769

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 42.592%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 37953
Covered Lines: 16165
Line Coverage: 42.59%
Coverage Strength: 11.91 hits per line

💛 - Coveralls

Base automatically changed from fix-frontier-more-bugs to main May 20, 2026 07:30
@rohanchkrabrty rohanchkrabrty enabled auto-merge (squash) May 20, 2026 07:35
@rohanchkrabrty rohanchkrabrty merged commit e5105b9 into main May 20, 2026
8 checks passed
@rohanchkrabrty rohanchkrabrty deleted the fix-member-update-role branch May 20, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants