Skip to content

Prevent swap KYC terms modal from stacking and dismiss abuse#5983

Merged
j0ntz merged 1 commit intodevelopfrom
jon/fix/swap-kyc-modal-popup
Mar 31, 2026
Merged

Prevent swap KYC terms modal from stacking and dismiss abuse#5983
j0ntz merged 1 commit intodevelopfrom
jon/fix/swap-kyc-modal-popup

Conversation

@j0ntz
Copy link
Copy Markdown
Contributor

@j0ntz j0ntz commented Mar 19, 2026

Description

Asana task

Fixes two bugs with the swap KYC terms verification modal:

  1. Stacking modals: When the quote auto-refresh timer expires while the terms modal is open, the scene replaces itself via SwapProcessingScene, remounts, and calls swapVerifyTerms again — stacking a duplicate modal on the still-open first one. Fixed by deferring the timer: if it fires while the terms modal is pending, the expiry is recorded and replayed after the modal resolves.

  2. Destructive dismissal: Backdrop tap, swipe-down, X button, and hardware back all resolved false, triggering changeEnabled(false) on the swap provider — silently removing it from exchange settings without clear user intent. Fixed by removing onCancel from the EdgeModal, making the modal non-dismissable. The user must now explicitly tap Accept or Reject.

Closes: https://app.asana.com/1/9976422036640/project/1200972350208303/task/1213613256799799

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

Note

Medium Risk
Changes swap confirmation navigation timing and makes the terms modal non-dismissible, which can affect swap quote refresh/timeout behavior and provider enablement in edge cases.

Overview
Fixes swap KYC/terms verification UX by making SwapVerifyTermsModal non-cancelable (users must explicitly Accept/Reject) to prevent accidental rejection from backdrop/back actions.

Updates SwapConfirmationScene to defer the auto-refresh/expiry timer while the terms check is open and replay expiration after the modal resolves, preventing duplicate stacked terms modals during quote refresh.

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

Copy link
Copy Markdown

@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.

Fix All in Cursor

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

@j0ntz j0ntz force-pushed the jon/fix/swap-kyc-modal-popup branch from e4974ae to e530d96 Compare March 25, 2026 22:43
Defer the quote auto-refresh timer while the terms modal is pending so
a scene remount cannot stack a second modal. Track deferred timer
expiry and replay it after the modal resolves to ensure fresh quotes.

Make the terms modal non-dismissable (no backdrop tap, swipe, or X
button) so the user must explicitly accept or reject. This prevents
accidental dismissal from silently disabling the swap provider.
@j0ntz j0ntz force-pushed the jon/fix/swap-kyc-modal-popup branch from e530d96 to 0a10457 Compare March 31, 2026 17:37
@j0ntz j0ntz merged commit 67259c8 into develop Mar 31, 2026
4 checks passed
@j0ntz j0ntz deleted the jon/fix/swap-kyc-modal-popup branch March 31, 2026 17:40
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