Skip to content

Permission warnings check the role live and go away once it is updated - #472

Merged
nambok merged 1 commit into
mainfrom
fix/live-permission-warnings
Nov 23, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/live-permission-warnings

Conversation

@nambok

@nambok nambok commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Infrastructure vulnerabilities warning ("needs N more read-only permissions in account ... Update the role in AWS") showed the saved permission check, which the worker refreshes once a day. After an admin created the update stack, the warning stayed until the next daily run. Pages that show a saved permission warning now check the role live while the warning is up, hide it when the check says nothing is left to do, and after Update keep checking the way Settings › AWS already does.

Changes

  • New shared hook usePermissionChecks (dashboard/src/hooks/use-permission-checks.ts), taken from useAwsPermissions:
    • It checks each warned account with POST /api/aws-connections/:id/permissions/check, which checks live and saves the result.
    • After Update is pressed, it checks again on focus, on returning to the tab, and every 15 seconds for 15 minutes.
    • Each page passes what "settled" means for its own warning.
    • useAwsPermissions is now a thin wrapper over it, so Settings › AWS behaves as before.
  • Security › Infrastructure (MissingReads):
    • The warned accounts are checked live. The card goes away when the live check finds the infrastructure reads, and shows the live list when the role still lacks some.
    • Pressing "Update the role in AWS" starts the watch.
    • Only people who can run the check (integrations) trigger it. A failed check keeps the saved warning.
  • Settings › Integrations, AWS account panel: the "Update needed" warning gets the same treatment. The live answer replaces the card's account, so the warning, the Update link and the summary all refresh.
  • Settings › AWS, infrastructure reads note (InfraReadsHelp): it uses the page's live check when that is newer than the saved one, so the note no longer repeats a stale list.
  • A quiet status line (PermissionCheckNote) on these warnings says "Checking the role now…" while a check runs, and "Waiting for the update" after Update.
  • Pages I left alone, because their warnings are not saved permission checks:
    • The Bedrock knowledge base role update is a one-time stack for the knowledge base, with no permission check behind it.
    • An import's "Update the role in one click" is the error from that import attempt, which the person retries.

Verification

  • npm run typecheck, npm run lint (UI lint) and root eslint on the changed files: clean. The dashboard has no vitest suite.
  • Playwright (chromium), all passing:
    • infra-security.spec.ts has 3 new tests:
      • The card disappears after the live check returns the reads (up_to_date), with "Checking the role now…" shown while the check is held.
      • The live list replaces the saved one. After Update, a focus event re-checks with pressed: true and the card goes away.
      • A failed check keeps the warning, and a member never runs the check.
    • integrations-page.spec.ts: a new test shows the panel's saved warning going away after the live check.
    • infra-aws-switch.spec.ts: a new test shows the AWS page note going away when the live check finds the reads.
    • Unchanged specs still pass: aws-permissions, aws-install-options, integrations, infra-runbooks, infra-policy and integration-status.

The Infrastructure vulnerabilities warning, the Integrations AWS panel's
update warning and the AWS page's infrastructure reads note showed the
saved permission check, which the worker refreshes once a day. Each now
checks the role live while it shows the warning, hides it when the check
comes back with nothing left to do, says quietly that it is checking, and
after Update checks again on focus, on returning to the tab and every 15
seconds, through one shared hook (usePermissionChecks).
@nambok
nambok merged commit 8f9922e into main Nov 23, 2026
10 checks passed
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.

1 participant