Skip to content

fix: close the Apple Wallet sheet when the issuer call fails - #132

Merged
JakubKorytko merged 5 commits into
Expensify:mainfrom
Brunonascdev:fix/ios-close-sheet-on-issuer-error
Oct 29, 2026
Merged

JakubKorytko merged 5 commits into
Expensify:mainfrom
Brunonascdev:fix/ios-close-sheet-on-issuer-error

Conversation

@Brunonascdev

@Brunonascdev Brunonascdev commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Details

If addCardToAppleWallet's issuer callback throws, the Add Payment Pass sheet used to stay open. PassKit was still waiting for a payload, and there was no way to close it.

IOSFailAddPaymentPass dismisses the sheet and drops the PassKit completion handler, because there is no payload to give it. It also clears the account id stored for the device lookup. addCardToAppleWallet calls it when the callback throws, then rethrows that error. Closing the sheet is best-effort: the issuer error is what the caller sees.

Android resolves the native method and does nothing. The public function still throws on Android, as before.

Related Issues

No existing issue. This showed up while adding a card from an app that is on TestFlight.

Manual Tests

This repo has no automated tests. Typecheck and lint pass. The example app builds for the iOS simulator with the new architecture. Android was not compiled here: the example app does not include the TapAndPay SDK. The Kotlin change is a stub that resolves the promise.

  • Start addCardToAppleWallet and throw from the issuer callback. The sheet closes and the thrown error reaches the caller.
  • A successful encrypt still adds the card.
  • Try again still calls the issuer callback again.

Linked PRs

Merged current main, which includes #91 and #96. IOSFailAddPaymentPass clears the account id that flow stores on the enrollment session. #133 and #134 also edit the spec, the README, or WalletManager.swift / RNWallet.mm. Whichever lands next will need a small merge.

A thrown encrypt callback used to leave the Add Payment Pass sheet waiting for a payload that would never arrive.
@Brunonascdev

Copy link
Copy Markdown
Contributor Author

The other splits of the same TestFlight patch are #133 and #134. #91 and #96 are the existing ones. They share the spec, the README, and WalletManager.swift / RNWallet.mm, so whichever lands second needs a small merge.

@Brunonascdev

Copy link
Copy Markdown
Contributor Author

@JakubKorytko for a look when you have a minute. Requesting a review from the fork returns a permissions error, so this comment is the ping.

@JakubKorytko JakubKorytko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

one wording fix below + conflicts

Comment thread README.md Outdated
@Brunonascdev

Copy link
Copy Markdown
Contributor Author

@JakubKorytko merged current main and addressed the review. IOSFailAddPaymentPass also clears the account id stored for the device lookup.

@JakubKorytko

Copy link
Copy Markdown
Member

conflicts with main, and may you address #91 (comment) here?

deviceType is only set on the completed response, so the other branch never has it.
@Brunonascdev

Copy link
Copy Markdown
Contributor Author

@JakubKorytko merged current main and removed the unused deviceType from the cancel/error branch of AddPassResponse, as asked in #91.

@JakubKorytko JakubKorytko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM now, thank you!

@JakubKorytko
JakubKorytko merged commit 1fc95e4 into Expensify:main Oct 29, 2026
7 of 8 checks passed
@os-botify

os-botify Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🚀 Published to npm in 0.2.25 🎉

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