Fix onboarding flow path changes after page refresh - #67017
Conversation
Add early path validation check in getOnboardingInitialPath to prioritize resuming existing onboarding paths on refresh instead of redirecting to personal-details. This ensures users remain on their current onboarding step when refreshing the page.
|
@DylanDylann 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] |
|
|
||
| if (onboardingInitialPath) { | ||
| const existingPathState = getStateFromPath(onboardingInitialPath, linkingConfig.config); | ||
| if (existingPathState?.routes?.at(-1)?.name === NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR) { | ||
| return onboardingInitialPath; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
| if (onboardingInitialPath) { | |
| const existingPathState = getStateFromPath(onboardingInitialPath, linkingConfig.config); | |
| if (existingPathState?.routes?.at(-1)?.name === NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR) { | |
| return onboardingInitialPath; | |
| } | |
| } | |
| if (onboardingInitialPath && state?.routes?.at(-1)?.name === NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR) { | |
| return onboardingInitialPath; | |
| } | |
There was a problem hiding this comment.
Nice catch, fixed
|
All contributors have signed the CLA ✍️ ✅ |
13d1ac3 to
118a515
Compare
Simplify the logic in getOnboardingInitialPath by removing unnecessary checks for existing path state. Now, it directly validates the onboardingInitialPath against the current state, ensuring a more streamlined onboarding flow.
118a515 to
2f7800b
Compare
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-07-25.at.14.02.14.movAndroid: mWeb ChromeScreen.Recording.2025-07-25.at.14.01.31.moviOS: HybridAppScreen.Recording.2025-07-25.at.14.03.23.moviOS: mWeb SafariScreen.Recording.2025-07-25.at.13.59.36.movMacOS: Chrome / SafariScreen.Recording.2025-07-25.at.13.54.23.movMacOS: DesktopScreen.Recording.2025-07-25.at.13.58.16.mov |
|
@MobileMage merge |
|
@lakchote done |
|
Congrats, that's your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It's an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
|
✋ 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/lakchote in version: 9.1.88-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|
Explanation of Change
Add early path validation check in getOnboardingInitialPath to prioritize resuming existing onboarding paths on refresh instead of redirecting to personal-details. This ensures users remain on their current onboarding step when refreshing the page by checking if the stored onboardingInitialPath is valid before falling back to domain/policy-based logic.
Fixed Issues
$ #65947
PROPOSAL: #65947 (comment)
Tests
Offline tests
Same as QA
QA Steps
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))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
onboard-path-android-native.mp4
Android: mWeb Chrome
onboard-path-android-mweb.mp4
iOS: Native
onboard-path-ios-native.mp4
iOS: mWeb Safari
onboard-path-ios-mweb.mp4
MacOS: Chrome / Safari
refresh.fix.desktop.web.mp4
MacOS: Desktop
onboard-path-desktop-native.mp4