Fix: 'Start over' button do not return to the 'Confirm currency and country'#76072
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@abdulrahuman5196 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] |
trjExpensify
left a comment
There was a problem hiding this comment.
Makes sense to start here when wiped. 👍
|
@nyomanjyotisa I am seeing a flash of old data while starting over @nyomanjyotisa could you check on this? Screen.Recording.2025-11-27.at.2.50.02.PM.mov |
Seems like this issue only happens on Android native. I've updated the PR to use a local react state |
|
@nyomanjyotisa I am not sure if this is the right approach of passing around a prop to solve this issue and using a requestAnimationFrame. Actually what is the stale data? Why is it not cleared? When does it get clear? |
RCAThe stale data is the country value stored in This draft is cleared in App/src/libs/actions/ReimbursementAccount/resetNonUSDBankAccount.ts Lines 17 to 19 in 4ae8e1d However, Onyx updates are asynchronous, while react state updates are synchronous When "Start Over" is clicked:
This is the log when we click on "Start Over"
Then later, after Onyx updates propagate
This race condition exists on all platforms, but I think Android native rendering cycle makes it more visible. React state updates and re-renders might happen faster, so the component renders before Onyx updates have fully propagated SolutionUse a local react state
With this change, the Country component only renders after the draft has been cleared from Onyx. The |
|
checking now |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-12-08.at.8.16.01.PM.movAndroid: mWeb ChromeScreen.Recording.2025-12-08.at.8.21.39.PM.moviOS: HybridAppScreen.Recording.2025-12-08.at.8.28.13.PM.moviOS: mWeb SafariScreen.Recording.2025-12-08.at.8.30.42.PM.movMacOS: Chrome / SafariScreen.Recording.2025-12-08.at.8.33.12.PM.mov |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @mjasikowski
🎀 👀 🎀
C+ Reviewed
|
✋ 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/mjasikowski in version: 9.2.74-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.2.74-12 🚀
|
Explanation of Change
Update
setNonUSDBankAccountStepto useCONST.NON_USD_BANK_ACCOUNT.STEP.COUNTRYinstead of null in order to navigate to the 'Confirm currency and country' step when starting overFixed Issues
$ #74809
PROPOSAL: #74809 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
Prerequisites: Use Expensifail account
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
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4