Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(react): skip plan refresh for access/role grant issues (#20054)
h3n4lc968ba17c339
diff --git a/frontend/src/react/pages/project/issue-detail/hooks/useIssueDetailPage.ts b/frontend/src/react/pages/project/issue-detail/hooks/useIssueDetailPage.tsindex e7c64a7dce..e96e0b1c2f 100644--- a/frontend/src/react/pages/project/issue-detail/hooks/useIssueDetailPage.ts+++ b/frontend/src/react/pages/project/issue-detail/hooks/useIssueDetailPage.ts@@ -33,7 +33,7 @@ import {Task_Status,type TaskRun,} from "@/types/proto-es/v1/rollout_service_pb";-import { unknownPlan } from "@/types/v1/issue/plan";+import { UNKNOWN_PLAN_NAME, unknownPlan } from "@/types/v1/issue/plan";import { getRolloutFromPlan, minmax, setDocumentTitle } from "@/utils";import type { ProjectIssueDetailPageProps } from "../types";import {@@ -209,7 +209,13 @@ const refreshIssueDetailSnapshot = async (.catch(() => undefined): undefined;- const planName = snapshot.plan?.name || issue?.plan;+ // Prefer the authoritative `issue.plan`; fall back to the snapshot only when+ // it holds a real plan (not the UNKNOWN placeholder used for access/role grants).+ const snapshotPlanName =+ snapshot.plan?.name && snapshot.plan.name !== UNKNOWN_PLAN_NAME+ ? snapshot.plan.name+ : undefined;+ const planName = issue?.plan || snapshotPlanName;if (!planName) {return {issue,diff --git a/frontend/src/react/pages/project/issue-detail/utils/refreshIssueDetailState.ts b/frontend/src/react/pages/project/issue-detail/utils/refreshIssueDetailState.tsindex da617dfc49..ac875c8fa5 100644--- a/frontend/src/react/pages/project/issue-detail/utils/refreshIssueDetailState.ts+++ b/frontend/src/react/pages/project/issue-detail/utils/refreshIssueDetailState.ts@@ -14,13 +14,27 @@ import {GetRolloutRequestSchema,ListTaskRunsRequestSchema,} from "@/types/proto-es/v1/rollout_service_pb";+import { UNKNOWN_PLAN_NAME } from "@/types/v1/issue/plan";import { getRolloutFromPlan } from "@/utils";import type { IssueDetailPageState } from "../hooks/useIssueDetailPage";export async function refreshIssueDetailState(page: Pick<IssueDetailPageState, "issue" | "patchState" | "plan">) {- if (!page.plan?.name) {+ // Issues without a plan (e.g., access/role grants) use an UNKNOWN placeholder.+ // Fetching it would hit "project -1 not found" — refresh only the issue instead.+ if (!page.plan?.name || page.plan.name === UNKNOWN_PLAN_NAME) {+ if (!page.issue?.name) {+ return;+ }+ const issueResult = await issueServiceClientConnect+ .getIssue(+ create(GetIssueRequestSchema, {+ name: page.issue.name,+ })+ )+ .catch(() => undefined);+ page.patchState({ issue: issueResult });return;}