feat(useAccessibleOrgs): accept triggerGetKeys as parameter for multi-app support - #1796
Conversation
…-app support Signed-off-by: Rishi Raj <rishiraj438gt@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesAccessible organization key retrieval
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: 🔵 Low · up to The hook now supports multiple API backends, but its organization cache could retain results from the wrong backend if the trigger source changes while the hook remains mounted. The PR is mergeable with explicit owner awareness or follow-up to make the trigger lifecycle immutable or reset caches when the source changes, and to verify external callers pass the correct trigger. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Description
The
useAccessibleOrgshook needs to work in both meshery-cloud and meshery. These two apps use different API layers to fetch user keys — meshery-cloud uses@meshery/schemas/cloudApi(direct cloud server) while meshery uses@meshery/schemas/mesheryApi(meshery server).Previously, the hook hardcoded the
cloudApiimport, which meant Meshery could not reuse it without duplicating the entire logic. This PR makestriggerGetKeysa required parameter so each app passes its own RTK Query lazy trigger, keeping all the permission-checking, caching, and parallel-query logic in one place.Changes:
useLazyGetUserKeysQueryimport fromcloudApi.triggerGetKeystoUseAccessibleOrgsOptionsTriggerGetKeystype for consumer convenienceRealated PRs
Meshery-Cloud - https://github.com/layer5io/meshery-cloud/pull/5971
Meshery - meshery/meshery#21366
Meshery-Cloud
Screen.Recording.2026-08-13.at.3.03.00.PM.mov
Meshery
Screen.Recording.2026-08-13.at.3.03.52.PM.mov
Signed commits
Summary by CodeRabbit