fix: recheck card in wallet when app regains focus in case user manually adds card to wallet - #76817
Conversation
Code Review SummaryI've reviewed the changes in this PR. The implementation looks good overall - adding useAppFocusEvent to recheck the card status when the app regains focus is a straightforward solution to handle manual wallet additions outside the app. Key Observations:✅ Proper hook usage: The useAppFocusEvent hook is correctly implemented with appropriate dependencies The implementation is clean and addresses the issue effectively. No blocking issues found. |
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where the "Add to Apple/Google Wallet" button doesn't update after a user manually adds their Expensify card to their device wallet outside the app. The solution adds a focus event listener to recheck the card's wallet status when the app regains focus.
Key Changes
- Added focus event listener to detect when app regains focus and recheck card wallet status
- Prevents unnecessary checks by verifying card availability before rechecking
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
trjExpensify
left a comment
There was a problem hiding this comment.
Nice little improvement to not show a redundant button 👍
|
@marcaaron Could you help test this change on a physical device? |
|
I'll prioritize review tmr |
|
Thank you @eh2077 |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Love the polish we're adding in this PR.
eh2077
left a comment
There was a problem hiding this comment.
The change looks good but I can't test it because I can't setup apple wallet on simulator.
Screen.Recording.2025-12-10.at.8.29.54.PM.mov
|
@samranahm Can you test it and upload recordings? Btw, I'll try build on physical iOS https://github.com/Expensify/App/blob/main/contributingGuides/HOW_TO_BUILD_APP_ON_PHYSICAL_IOS_DEVICE.md |
|
@eh2077 I tried building on a physical device but it didn’t complete for me, so I think we can test this using an Ad-Hoc build instead. wdyt? |
|
@youssef-lr Could you help trigger a build for us to test? thanks |
|
I can trigger a build, but I don't have access to the developer console for device provisioning. |
|
🚧 @trjExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
I’m not able to install the build and getting the error: “This app cannot be installed because its integrity could not be verified.” @youssef-lr could you take a look when you get a moment? |
|
@samranahm can you DM me on Slack your device's UUID? |
|
@youssef-lr DM’d you. |
|
Hey @eh2077, I just got an update from @youssef-lr we’ve already reached the device limit, so no new UDID can be added at the moment. |
|
I'm going to test this today on my device |
|
@samranahm can you check the react compiler issues? you can run this locally to test your changes |
…-button-displayed
|
It's been fixed on main. |
|
@youssef-lr Please take a look. |
|
Sorry, I seem to have the same issue as I have recently switched to using a new device. |
|
The change seems pretty simple, shall we let QA handle the testing on staging? I can also keep an eye on it and test it myself once it reaches staging. cc @trjExpensify |
|
Yeah, go for it. 👍 |
|
@eh2077 can you post the checklist? |
|
@eh2077 gentle bump #76817 (comment) |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppsee #76817 (comment) iOS: mWeb SafariMacOS: Chrome / Safari |
|
@youssef-lr All yours. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.2.87-0 🚀
|
|
@samranahm When trying to add an Expensify card to the Wallet, we get the following error: This card is not eligible for Apple pay. The same with Android. Is it bug or we missing something? 76817-iOS.mp4
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.87-7 🚀
|

Explanation of Change
Fixes the issue where “Add to Apple/Google Wallet” button doesn’t update if the user manually adds the Expensify card outside the app. Added a focus listener to recheck the card’s presence in wallet when app regains focus.
Fixed Issues
$ #75066
PROPOSAL: #75066 (comment)
Tests
Precondition: Have assigned virtual Expensify card
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Not able to reveal the Expensify card details due to this issue, I will add the Screenshots/Videos shortly.
Screenshots/Videos
Android: Native
Android: mWeb Chrome
N/AiOS: Native
iOS: mWeb Safari
N/AMacOS: Chrome / Safari
N/A