Skip to content

Keep the newest saved AWS permission check - #807

Merged
nambok merged 1 commit into
mainfrom
fix/keep-newest-permission-check
Nov 23, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/keep-newest-permission-check

Conversation

@nambok

@nambok nambok commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Infrastructure vulnerabilities warning's missing list (InfraAccount.missing, from AwsAccount::infra_missing) already reads the one saved check on the account, permissions_check. Both the daily sweep (aws_permissions pass) and a page's live check (POST /api/aws-connections/:id/permissions/check) write that field. A sweep that started before an admin's update could finish after the live check and overwrite it with the older result, bringing the warning back. The save now keeps whichever check is newest.

Changes

  • common::live::aws_account::save_permissions:
    • Each save also writes permissions_checked_ms (when the check ran) and replaces the saved check only when nothing newer is there.
    • An older check, or an account that is gone, is not an error.
    • A check whose time can't be read saves as before.
  • New pure helper checked_ms, with a unit test.
  • No reader changes: the gateway's infrastructure view, the AWS page and Integrations already read this one saved check.

Verification

Every reader of an AWS account (the Infrastructure vulnerabilities warning,
the AWS page, Integrations) shows the saved permission check. The daily
sweep and a page's live check both save it, and a sweep that started before
an update could overwrite the newer live result. A save now carries when
its check ran and only replaces an older one.
@nambok
nambok merged commit 50b42bf 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