-
-
Notifications
You must be signed in to change notification settings - Fork 256
chore: refresh gator permissions map after revocation state change #7235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: refresh gator permissions map after revocation state change #7235
Conversation
mj-kiwi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
packages/gator-permissions-controller/src/GatorPermissionsController.test.ts
Show resolved
Hide resolved
jeffsmale90
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One very inconsequential nit
packages/gator-permissions-controller/src/GatorPermissionsController.ts
Outdated
Show resolved
Hide resolved
…roller.ts Co-authored-by: jeffsmale90 <6363749+jeffsmale90@users.noreply.github.com>
jeffsmale90
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noice
…efresh-gator-permissions-map-after-revocation-state-change
Explanation
What is the current state of things and why does it need to change?
Currently, when a revocation transaction changes state (confirmed, failed, or dropped), the
GatorPermissionsControlleronly submits the revocation (on confirmation) or cleans up listeners. However, it doesn't refresh the local permissions map to reflect the updated state from the permissions provider.This creates a potential inconsistency where:
This means the UI could display outdated permission states, leading to confusion or incorrect actions by users.
What is the solution your changes offer and how does it work?
This PR introduces automatic permission refresh after revocation transaction state changes:
Added a
refreshPermissionshelper function that callsfetchAndUpdateGatorPermissions({ isRevoked: false })with fire-and-forget semantics, catching and logging any errors to prevent them from blocking cleanup operations.Integrated refresh into transaction handlers:
.finally()block to ensure the map reflects the new revoked stateError handling: The refresh operation is intentionally fire-and-forget with error logging, ensuring that refresh failures don't interfere with the cleanup flow or cause user-visible errors.
Checklist
Note
Automatically refreshes the gator permissions map after revocation transactions are confirmed, failed, or dropped, with accompanying tests and changelog updates.
src/GatorPermissionsController.ts):refreshPermissionshelper to callfetchAndUpdateGatorPermissions({ isRevoked: false })after revocation state changes.transactionConfirmed: callsubmitRevocationthen refresh in.finally(...).transactionFailedandtransactionDropped: cleanup and refresh permissions.src/GatorPermissionsController.test.ts):flushPromisesand use it to await async flows.permissionsProvider_getGrantedPermissionswith{ isRevoked: false }after confirmed/failed/dropped states.Written by Cursor Bugbot for commit 27160c3. This will update automatically on new commits. Configure here.