Fixed: handle dialog closure case in confirmation flow #195
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.
When the confirmation dialog is closed (result is null), the promise should resolve with false to indicate that the user did not grant confirmation. This adds proper handling for the dialog closure scenario and includes a corresponding test case.
Description
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2025-10-14.at.2.49.11.PM.mov
After
Screen.Recording.2025-10-14.at.2.44.23.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Handle dialog closure by resolving false and refine cleanup/unbind logic; add test coverage for closure behavior.
packages/gator-permissions-snap/src/core/confirmation.tsx
):snap_dialog
returningnull
(dialog closed) by cleaning up without resolving the interface and resolvingfalse
.cleanup
to acceptresolveInterface
flag and safely unbind handlers with try/finally; centralize unbind logic in#unbindHandlers
.packages/gator-permissions-snap/test/core/confirmation.test.ts
):false
when dialog is closed and that event listeners are unbound.Written by Cursor Bugbot for commit 4261d0f. This will update automatically on new commits. Configure here.