Skip to content

fix(explore-dash): stop stranding the merchant sheet over the amount screen - #1086

Merged
romchornyi merged 1 commit into
developfrom
fix/merchant-sheet-double-present
Aug 31, 2026
Merged

romchornyi merged 1 commit into
developfrom
fix/merchant-sheet-double-present

Conversation

@romchornyi

@romchornyi romchornyi commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Buying a gift card from a physical merchant that requires a DashSpend login leaves the merchant details sheet stranded on top of the Enter Amount screen. It sets isModalInPresentation = true, so it cannot be swiped away — leaving the flow and re-entering is the only way out.

Reported from manual testing on an iOS 26.5 simulator.

The cause is ordering, not the sheet itself:

  1. showDashSpendAuth goes through performAfterDismissingDetailsSheetIfNeeded, which dismisses the details sheet and resets didPresentDetailsSheet = false — deliberately, so the sheet returns when the user comes back.
  2. On success the flow pops back to POIDetailsViewController and calls showDashSpendPayScreen in the same turn.
  3. The push wins the race: by then detailsSheetViewController is nil, so performAfterDismissingDetailsSheetIfNeeded finds nothing to dismiss and calls its action straight through, pushing the amount screen.
  4. viewDidAppear — from the pop in step 2 — arrives after that push, sees the reset flag and presents the details sheet on top of the screen that was just pushed.

What was done?

Gate the presentation on this controller actually being the top of its navigation stack:

if let navigationController, navigationController.topViewController !== self { return }

Returning to the details screen still re-presents the sheet, because at that point the controller is the top. The modal-presentation case (no navigation controller) is unaffected.

How Has This Been Tested?

  • Clean dashpay build for the arm64 iOS Simulator.

The failure is a navigation race that needs the DashSpend login path with a physical merchant to reproduce, so it is worth exercising on a device: buy a gift card from a physical merchant while logged out, complete the login, and confirm the Enter Amount screen comes up clean.

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

Summary by CodeRabbit

  • Bug Fixes
    • Prevented merchant and ATM details from reopening over gift-card payment screens after navigating away.
    • Details sheets now appear only when the relevant details screen is active.

…screen

Buying a gift card from a physical merchant that needs a login leaves the
merchant details sheet on top of the Enter Amount screen, where
`isModalInPresentation` means it cannot be swiped away. Leaving the flow and
re-entering clears it.

The order is what does it. `showDashSpendAuth` dismisses the details sheet
before pushing the login screen, and that reset `didPresentDetailsSheet` so
the sheet would come back when the user returned. On success the flow pops
back here and pushes the amount screen in the same turn — and the push runs
first, because `performAfterDismissingDetailsSheetIfNeeded` finds no sheet to
dismiss and calls straight through. `viewDidAppear` then arrives after the
push, sees the reset flag, and presents the sheet over the screen that was
just pushed.

Present only while this controller is actually the top of its navigation
stack. Returning here still re-presents the sheet, because by then it is.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bb041ba4-f1a1-4d29-bbcb-b80889453f22

📥 Commits

Reviewing files that changed from the base of the PR and between a84fe62 and f84fce0.

📒 Files selected for processing (1)
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The POI details sheet now presents only when POIDetailsViewController is the navigation controller’s top view controller. This prevents the sheet from appearing over pushed gift-card payment screens.

Changes

POI details presentation

Layer / File(s) Summary
Navigation visibility guard
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift
presentDetailsSheetIfNeeded() checks the navigation stack before presenting the details sheet.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to f84fc

The change prevents the merchant details sheet from covering the payment screen during navigation. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: jeanpierreroma

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing the merchant sheet from remaining over the amount screen in Explore Dash.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/merchant-sheet-double-present

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head f84fce0. The navigation-stack guard fixes the delayed sheet presentation race without affecting normal return behavior. No blockers found.

@romchornyi
romchornyi merged commit 631b6f0 into develop Aug 31, 2026
2 checks passed
@romchornyi
romchornyi deleted the fix/merchant-sheet-double-present branch August 31, 2026 08:35
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.

3 participants