Skip to content

avoid double-settling Promise in checkWalletAvailability#71

Open
MegaManSec wants to merge 1 commit intoExpensify:mainfrom
MegaManSec:pr/jr-4-6acaa43
Open

avoid double-settling Promise in checkWalletAvailability#71
MegaManSec wants to merge 1 commit intoExpensify:mainfrom
MegaManSec:pr/jr-4-6acaa43

Conversation

@MegaManSec
Copy link

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)
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