Repository navigation
fix organization switcher selection and permission typo - #19933
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the organization switching logic in both OrgSwitcher and SpaceSwitcher to use RTK Query mutations asynchronously with error handling, and corrects a disabled check in DeployConfirmationModal. However, in both switchers, the RTK Query mutation trigger updateSelectedOrg needs to call .unwrap() to ensure that errors are actually thrown and caught by the catch blocks, preventing the UI from reloading on a failed backend update.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Rishi Raj <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Rishi Raj <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR aims to improve organization switching reliability in the Meshery UI by persisting the selected organization to the backend before reloading, ensuring the correct org is shown/used on the permission-denied (Oops) page, and correcting a permission check in the deploy confirmation flow.
Changes:
- Persist selected organization via the user preferences update flow before triggering an app reload.
- Make the Oops page org switcher fall back to backend-selected org when Redux org state is missing.
- Fix the
DeployConfirmationModalability check to use the correct permission “subject” field.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ui/components/workspaces/SpacesSwitcher/SpaceSwitcher.tsx | Adds notification-backed error handling around org selection persistence prior to reloading. |
| ui/components/general/error-404/OrgSwitcher.tsx | Uses backend-selected organization when Redux org is unavailable and persists selection before reload. |
| ui/components/designs/lifecycle/DeployConfirmationModal.tsx | Fixes the permission check to use subject for VALIDATE_DESIGN. |
Signed-off-by: Rishi Raj <[email protected]>
|
Commit SHA: END-TO-END TESTS
📦 Test Result Summary
⌛ Duration: 11 minutes and 36 seconds Overall Result: 👎 Some tests failed. [Show/Hide] Test Result Details
❌ Failed Test Details The following tests failed. Click on each to see the failure reason: ❌ Grafana elements on metrics tab (Local - chromium-local-provider)File Location: Error Message: Code Snippet: ❌ Create a Model (Local - chromium-local-provider)File Location: Error Message: 🔗 Relationship Tests [Show/Hide] Relationship Test Details (18 tests)
|
Description
This PR fixes #19931 and addresses a few issues related to organization switching.
DeployConfirmationModal.OrgSwitcherthat were causing build issues.Approach
I found that the organization dropdown on the Oops page was not always showing the correct active organization. Since the global layout is not mounted on that page, the Redux organization state can be unavailable. To address this,
OrgSwitchernow uses the organization returned by the backend when Redux state is missing, ensuring the correct organization is displayed and other organizations remain selectable.I also updated the organization switch flow to save the selected organization on the backend before reloading the application. If the update fails, the reload is skipped and an error message is shown to prevent the UI from getting out of sync with the backend state.
Additionally, this PR fixes the permission check in
DeployConfirmationModaland updates RTK Query imports to use the correct path alias, resolving build issues.Verification
make ui-buildsuccessfully.Demo: Added a video demonstrating the fix.
Screen.Recording.2026-06-08.at.9.46.41.PM.mov
Signed commits