Skip to content

fix: make user-triggered UI transitions single-flight - #1001

Draft
PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:codex/harden-ui-single-flight
Draft

fix: make user-triggered UI transitions single-flight#1001
PastaPastaPasta wants to merge 1 commit into
dashpay:developfrom
PastaPastaPasta:codex/harden-ui-single-flight

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

When the main thread is stalled, UIKit can queue several taps for the same control. The legacy onboarding flows generally treated each delivered event as a fresh action. In the observed case, repeated taps on Recover Wallet pushed the recovery controller once per queued tap after the main thread resumed.

The audit found the same class of risk at other one-way onboarding, authentication, modal, and delegate-completion boundaries. It also found two recovery-validation branches that explicitly presented a custom repair alert and then immediately presented a second generic alert.

What was done?

  • Added a reusable per-view-controller exclusive-action gate, exported to both Swift and Objective-C. It is acquired synchronously before navigation, presentation, authentication, or delegate completion can yield back to the run loop.
  • Made BaseNavigationController reject pushes while a push transition is already in progress, using its existing transition state as a stack-wide safety net.
  • Hardened onboarding/setup entry points, PIN creation, biometric setup, recovery submission (button and keyboard Return), backup/seed verification, the success screen, Payments close, and lock-screen actions.
  • Added explicit release behavior for cancellation, recoverable failure, returning to a source screen, sheet dismissal, and QR-scan cancellation.
  • Added defense-in-depth completion latches at the initial onboarding and setup-to-root boundaries, so a repeated child callback cannot repeat wallet recovery prompts or root transitions.
  • Added a completion latch around the delayed seed-verification callback.
  • Removed the two duplicate recovery alert presentations discovered by the audit.

Existing domain-level single-flight protections in wallet add/switch/remove, swaps, shielded transfers, contact actions, payment confirmation, and sync retry were reviewed and retained.

How Has This Been Tested?

  • Passed a full optimized simulator build:
    • scheme: dashpay
    • configuration: Release
    • destination: iPhone 17 Pro, iOS 26.5
  • Verified the shared selectors are emitted in dashwallet-Swift.h for Objective-C callers.
  • Added unit coverage for exclusivity, explicit release, and per-controller isolation.
  • Ran git diff --check successfully.

Focused unit-test execution is currently blocked by an unrelated develop test-host target-membership failure: the dashwallet target compiles DashPay-only references such as ContactAvatarView, CurrentUserProfileModel, and JoinDashPayViewModel without their defining source files. The Release dashpay application target builds successfully.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

This pull request was created by Codex.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e09f7bc-d41a-47ab-ac07-fd1cf925f8f7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

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