[CSM Portal] profile platform roles, drop unused dashboard-API flag, fix stale-chunk reload guard, silent re-auth before sign-in redirect - #1185
Merged
cloby99 merged 4 commits intoJul 21, 2026
Conversation
The dashboard-data flag and its enable/disable plumbing added complexity for a backend endpoint that does not exist yet. Removed the fetch hook, the flag, and the engineer/isError props entirely; the header now shows a static "Engineer overview" label. This code can be reintroduced once the backend ships GET /csm/dashboard.
…sgardeo groups The profile modal listed the Asgardeo ID token's `groups` claim under a "Groups" heading, but this platform authorizes off its own data, not IdP claims — Asgardeo groups aren't a reliable role list. Switched to the `roles` array already returned by GET /users/me, rendered the same way CsmUsersPage already displays a user's roles.
Contributor
📝 WalkthroughWalkthroughThe profile modal now displays user roles with loading and overflow handling. The CSM dashboard removes page-level ABT data fetching, engineer/error header props, and related dashboard data types and hook files. ChangesUser profile roles
Dashboard data decoupling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
The chunk-reload guard was set once and never cleared, so it only auto-recovered the first stale-deploy chunk failure a tab ever hit; any later one (e.g. after a subsequent deploy, hours into the same open tab) silently did nothing instead of reloading. Clear the guard 10s after a clean mount so a later, distinct failure still gets one auto-reload.
…edirect When the refresh token is dead, useAuthApiClient immediately redirected the whole tab to sign-in, discarding any in-progress work (an open comment draft, an unsaved dialog). Try a hidden-iframe silent re-authentication first: if the IdP session is still alive it mints a fresh token with no visible navigation, so only a genuinely dead IdP session falls through to the hard redirect.
cloby99
approved these changes
Jul 21, 2026
This was referenced Aug 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Four small, independent CSM Portal frontend fixes:
groupsclaim under a "Groups" heading, but this platform authorizes off its own data, not IdP claims — Asgardeo groups aren't a reliable role list.CSM_DASHBOARD_API_IMPLEMENTEDflag and matching fetch-disable plumbing for a backend endpoint (GET /csm/dashboard) that doesn't exist yet, which added complexity without any current benefit.useAuthApiClientimmediately redirected the whole tab to a full sign-in, discarding any in-progress work (an open comment draft, an unsaved dialog) even when the user's underlying IdP session was still alive.Goals
rolesarray already returned byGET /users/me, rendered the same wayCsmUsersPagealready displays a user's roles.Approach
UserProfileModal.tsx: switched the "Groups" section to read platform roles from/users/meinstead of the Asgardeo ID token'sgroupsclaim.useGetCsmDashboard.ts(the disabled fetch hook), theCSM_DASHBOARD_API_IMPLEMENTEDflag inCsmDashboardPage.tsx, and the now-unusedengineer/isErrorprops inAbtDashboardHeader.tsx(which now shows a static "Engineer overview" label). Removed the now-unusedCsmDashboardEngineer/CsmAbtDashboardDatatypes.main.tsx: hoisted theRELOAD_GUARD_KEYsessionStorage key to module scope and added a 10s post-mountsetTimeoutthat clears it, so a mount that stays up long enough to prove it's healthy (not the same failure looping) re-arms the guard for the next distinct failure.useAuthApiClient.ts: on a still-unauthenticated retry, callsignInSilently()(hidden iframe) beforeredirectToSignIn(). Single-flighted via a module-scopedsilentSignInInFlightpromise, same pattern as the existingsignInInFlightguard, so concurrent requests hitting the dead token at once await one shared attempt. On success, the original request is retried once more; if it still fails with a token-expired error (e.g. a race with a session that expires a moment later), it falls through to the existing hard redirect.User stories
N/A
Release note
Documentation
N/A — internal FE cleanup, no user-facing docs impact.
Training
N/A
Certification
N/A — no exam-relevant changes.
Automation tests
pnpm test); no new failures introduced (3 pre-existing failing files unrelated to this change, verified againstmain).Security checks
Samples
N/A
Related PRs
None
Migrations (if applicable)
N/A
Test environment
Local
pnpm build/pnpm lint/pnpm teston macOS (Darwin), Node/pnpm toolchain per repopackage.json.Learning
N/A