-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expensify card page uses navigation for magic code #70736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expensify card page uses navigation for magic code #70736
Conversation
|
@ishpaul777 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
hey @jmusial do you know how can i add a EXFY card in test account? if i try to enable wallet with fake plaid credentials it still asks me identity verfiication Screen.Recording.2025-09-18.at.4.05.32.AM.mov |
|
@ishpaul777 are you using a staging server for backend ? |
|
yes i am using staging server @jmusial 🤔 |
And I see your data seems ok for the test flow. Not sure I can help here, sorry :( For me when it was asking me for verification it was either I put one of the Alberta's data wrong or not using staging server from the very beginning of the flow |
|
i am adding data from these steps https://expensify.slack.com/archives/C01GTK53T8Q/p1711049892429129?thread_ts=1711049879.962529&cid=C01GTK53T8Q, can you check if its correct? |
I'm using same ones :( |
This comment was marked as resolved.
This comment was marked as resolved.
| import React, {createContext, useMemo, useState} from 'react'; | ||
| import type {ExpensifyCardDetails} from '@src/types/onyx/Card'; | ||
|
|
||
| type ExpensifyCardContextProviderPropsProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| type ExpensifyCardContextProviderPropsProps = { | |
| type ExpensifyCardContextValue = { |
| FullScreenLoaderContextProvider, | ||
| ModalProvider, | ||
| SidePanelContextProvider, | ||
| ExpensifyCardContextProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the card details were stored in the component state, so when the RHP was closed the user had to re-enter the magic code. Now, the details are stored in the app context, meaning they persist until a hard refresh. Are we okay with this change in behavior?
Would love your input here, @mountiny.
Screen.Recording.2025-09-19.at.2.07.29.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gentle bump @mountiny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the RHP is closed and reopened, is new code always sent?
If yes we should reset it
if no, if you start a different flow that will need the magic code, that reset the form, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Common
- Go to Settings -> Wallet
- Press on one of the assigned cards
- Press on Reveal details
- Type in the code
- See the card A details
- Close the Card details RHP
- Click on the card A details
Old behaviour:
8. You need to go through 3 - 5 to see the card details (card details stored in state)
New behaviour:
8. You can see the card details (stored in context)
Common:
9. Close the Card details RHP
10. Click on card Bdetails
11. You need to go through 3 - 5 to see the card details
I'll reset it on closing to align with old behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooooh you mean card details like PAN and pic, ok I do think that was in state only on purpose. Why do you need to add it to the context to share it across screens? I believe we want this data to be as safe and secure as possible so the previous approach was safer imho
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@ishpaul777 resetting the state of Card details (just web video bc I maxed out on magic codes for today :( ) Screen.Recording.2025-09-26.at.17.37.16.mov |
|
will rereview today! |
|
@ishpaul777 Let me know when done! |
|
edit: have to leave early for the day this but this is on top on list when i start tomorrow |
| // This resets card details when we exit the page. | ||
| useBeforeRemove(() => { | ||
| setCardsDetails((oldCardDetails) => ({...oldCardDetails, [cardID]: null})); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to confirm, are you confident that sensitive card data would not persist in the app even after the pages are exited? Basically, that was the benefit of using the state here, when the component unmounted, this data was cleared. I think we want to ensure the same level of security here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my testing it seems to work fine for all the cases, going back using on screen <, device back button and dismissing rhp on click out side RHP, user has to reenter the code to reveal the details
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-01.at.4.34.22.AM.movAndroid: mWeb ChromeScreen.Recording.2025-10-01.at.5.30.29.PM.moviOS: HybridAppScreen.Recording.2025-10-01.at.3.15.34.AM.moviOS: mWeb SafariScreen.Recording.2025-10-01.at.3.28.19.AM.movMacOS: Chrome / SafariScreen.Recording.2025-10-01.at.2.58.44.AM.movMacOS: DesktopScreen.Recording.2025-10-01.at.5.37.22.PM.mov |
|
@jmusial please fix conflicts |
|
@ishpaul777 bump |
|
I'll still retest since main is merged and approve this in few mins |
|
|
||
| /** | ||
| * Hook to display revealed expensify card data and pass it between screens. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
✋ 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/mountiny in version: 9.2.23-0 🚀
|
|
Hi @jmusial Card details get hidden after going back & selecting same virtual card Bug6964207_1759527731164.03.10.2025_17.20.11_REC6.mp4Do we need create new GH ticket for this? |
|
@izarutskaya not sure I understand. You pasted a video from staging ? Also I checked and staging & prod behave the same rn |
|
@jmusial Yes, it's staging |
|
yeah, 100% expected & consistent with current behaviour |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.2.23-3 🚀
|
Explanation of Change
This PR rewrites Expensify card details preview verification to use navigation instead of modals.
Fixed Issues
$ #69171
PROPOSAL:
n/a
Tests
Assumption: The account has a workspace with at least one Expensify virtual card created
Offline tests
n/a
QA Steps
Same as tests
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.Screenshots/Videos
Android: Native
0046.android.native.mov
Android: mWeb Chrome
0046.android.chrome.mov
iOS: Native
0046.ios.native.mp4
iOS: mWeb Safari
0046.ios.safari.mp4
MacOS: Chrome / Safari
0046.desktop.chrome.mov
MacOS: Desktop
0046.desktop.native.mov