Feat/new contact method confirm magic code uses navigation#71166
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@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] |
|
will review this today |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-08.at.11.35.55.PM.movAndroid: mWeb ChromeScreen.Recording.2025-10-08.at.11.30.59.PM.moviOS: HybridAppScreen.Recording.2025-10-08.at.7.17.46.PM.moviOS: mWeb SafariUntitled.movMacOS: Chrome / SafariScreen.Recording.2025-10-08.at.3.37.08.PM.movMacOS: Desktop |
|
I keep hitting the magic code limit, so I couldn’t finish all the platform videos 😞. I’ll try again a bit later today. |
I feel ya :( Using VPN and a different country helps extend it a little |
There was a problem hiding this comment.
i dont think its a blocker, but it should be in @libs
There was a problem hiding this comment.
nvm i see there are multiple usage of utils in @pages already
thnks! will try it next time : ) |
| */ | ||
| function addPendingContactMethod(contactMethod: string) { | ||
| Onyx.merge(ONYXKEYS.PENDING_CONTACT_ACTION, { | ||
| return Onyx.merge(ONYXKEYS.PENDING_CONTACT_ACTION, { |
There was a problem hiding this comment.
I think this violates our philosophy
Why do you need to return a promise?
There was a problem hiding this comment.
Yeah, it was needed in prev version, forgot but I found a better way :D
Forgot to remove it
There was a problem hiding this comment.
but it's was an interesting case.
Basically bc Onyx.merge is async underneath, when I wanted to just update pending action in local onyx and then navigate I could find other way to guarantee that state will be updated when next page renders.
Do you know what would be recommended in that scenario if I cannot return a promise here ?
There was a problem hiding this comment.
Not sure for this specific case, but as the rules states the UI should react to the data changes so I would assume we would need to get that logic into some useEffect or something that would listen to the change and run when the onyx change propagates
| // Waiting for the action to finish before navigating. | ||
| // Otherwise it may cause an incorrect state on the confirm screen due to async nature of Onyx.merge | ||
| addPendingContactMethod(submitDetail); |
There was a problem hiding this comment.
I think there must be some other ways to handle this than returning the promise
|
Fixed. |
|
✋ 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.29-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.29-5 🚀
|
Explanation of Change
Fixed Issues
$ #69171
PROPOSAL:
N/A
Tests
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
0051.android.native.mov
Android: mWeb Chrome
0051.android.chrome.mov
iOS: Native
0051.ios.native.mov
iOS: mWeb Safari
0051.ios.safari.mov
MacOS: Chrome / Safari
0051.desktop.chrome.mov
MacOS: Desktop
0051.desktop.native.mov