Skip to content

avoid double-settling Promise in checkWalletAvailability - #71

Merged
JakubKorytko merged 2 commits into
Expensify:mainfrom
MegaManSec:pr/jr-4-6acaa43
Oct 1, 2026
Merged

JakubKorytko merged 2 commits into
Expensify:mainfrom
MegaManSec:pr/jr-4-6acaa43

Conversation

@MegaManSec

Copy link
Copy Markdown
Contributor

TapAndPay environment Task invokes onComplete for both success and failure; our handler always resolve()d there, then also reject()d in addOnFailureListener. On failures this meant the same React Native Promise could be settled twice (resolve then reject), causing “Promise already settled” warnings and flaky JS-side behavior. Handle the result in a single callback and resolve once with task.isSuccessful.

TapAndPay environment Task invokes onComplete for both success and failure; our handler always resolve()d there, then also reject()d in addOnFailureListener. On failures this meant the same React Native Promise could be settled twice (resolve then reject), causing “Promise already settled” warnings and flaky JS-side behavior. Handle the result in a single callback and resolve once with task.isSuccessful.

(cherry picked from commit 6acaa43e50bc63f4ae48746849b36d2f00fe6d48)
Comment thread android/src/main/java/com/expensify/wallet/WalletModule.kt
Co-authored-by: Jakub Korytko <jakub.korytko@o2.pl>

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

all good now, thanks!

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

os-botify Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Published to npm in 0.1.33 🎉

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