Skip to content

Retry attempts to close the dialog#274

Merged
jeffsmale90 merged 2 commits intomainfrom
feat/retry_dialog_close
Mar 5, 2026
Merged

Retry attempts to close the dialog#274
jeffsmale90 merged 2 commits intomainfrom
feat/retry_dialog_close

Conversation

@jeffsmale90
Copy link
Contributor

@jeffsmale90 jeffsmale90 commented Mar 3, 2026

Description

Sometimes after clicking "Grant" on the Permission Picker, sometimes the dialog does not close before loading the Sign Permission Confirmation.

This PR adds retry logic to the attempt to close the dialog:

  • if the first attempt fails, we check whether the dialog exists (by calling snap_getInterfaceContext)
  • if the dialog does exist, we try again
  • if the second attempt fails, we just resolve for now

This is difficult to test, as we do not have reproduction steps yet.

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes dialog teardown behavior by adding retries and interface-existence checks, which could affect UI flow timing and state cleanup if snap RPC calls behave unexpectedly. Covered by expanded unit tests, but still touches user-facing confirmation transitions.

Overview
Improves DialogInterface.close() to be best-effort and more resilient: it now retries snap_resolveInterface up to 3 times, checks for interface existence via snap_getInterfaceContext, and always clears local dialog state without throwing.

Updates unit tests to cover success, retry, already-closed, and repeated-failure scenarios, and removes an unused auth argument from the createProfileSyncManager call.

Written by Cursor Bugbot for commit 73cc32d. This will update automatically on new commits. Configure here.

@jeffsmale90 jeffsmale90 requested a review from a team as a code owner March 3, 2026 00:42
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@jeffsmale90 jeffsmale90 force-pushed the feat/retry_dialog_close branch from 01135f9 to 73cc32d Compare March 5, 2026 21:57
@jeffsmale90 jeffsmale90 merged commit 48819c6 into main Mar 5, 2026
5 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/retry_dialog_close branch March 5, 2026 21:57
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.

2 participants