Fix onboarding modal that flashes for user transitioning from OldDot#49263
Conversation
| const hasCompletedGuidedSetupFlow = hasCompletedGuidedSetupFlowSelector(onboarding); | ||
|
|
||
| // We need skip deeplinking if the user hasn't completed the guided setup flow. | ||
| if (!hasCompletedGuidedSetupFlow) { | ||
| Welcome.isOnboardingFlowCompleted({ | ||
| onNotCompleted: () => OnboardingFlow.startOnboardingFlow(), | ||
| }); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Are you sure we can fully remove this?
There was a problem hiding this comment.
After consulting with @adamgrzybowski I'm not so sure 😅
There was a problem hiding this comment.
I'll revert it for now, as in some flows we might never hit the redirect to onboarding because of this change.
There was a problem hiding this comment.
Need more testing and I don't want to block this PR, what do you think we could clean the onboarding logic a bit in a follow-up PR?
There was a problem hiding this comment.
I think the logic there is redundant a bit, right? we check if the modal should show and then we call Welcome.isOnboardingFlowCompleted which does the same technically, so we could refactor this to only check hasCompletedGuidedSetupFlowSelector and run OnboardingFlow.startOnboardingFlow() if the modal should show.
but we can leave this for later
There was a problem hiding this comment.
Oh right, that looks redundant too. I was focusing around the fact that we also navigate the user in NavigationRoot.tsx:
// If the user haven't completed the flow, we want to always redirect them to the onboarding flow.
// We also make sure that the user is authenticated.
if (!NativeModules.HybridAppModule && !hasCompletedGuidedSetupFlow && authenticated && !shouldShowRequire2FAModal) {
const {adaptedState} = getAdaptedStateFromPath(getOnboardingInitialPath(), linkingConfig.config);
return adaptedState;
}I think we should create an issue to clean this up a bit, because I don't see a reason why we have many places in the code where we redirect to onboarding flow 🤷♂️
… OldDot" This reverts commit 46960fd.
|
@ikevin127 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] |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2024-09-16.at.8.26.26.PM.movScreen.Recording.2024-09-16.at.8.30.11.PM.movMacOS: DesktopScreen.Recording.2024-09-16.at.8.37.57.PM.movAndroid: NativeScreen.Recording.2024-09-16.at.8.46.48.PM.movAndroid: mWeb ChromeScreen.Recording.2024-09-16.at.8.42.43.PM.moviOS: NativeScreen.Recording.2024-09-16.at.8.52.41.PM.moviOS: mWeb SafariScreen.Recording.2024-09-16.at.8.54.19.PM.mov |
The P/S makes sense to me and is logical too, working on videos now; |
allgandalf
left a comment
There was a problem hiding this comment.
Change is simple and works well, have tested for all platform 👍
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@blazejkustra I am not sure if the QA team can run this step, could you help?
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.36-0 🚀
|
@kavimuru Yes, you should be able to do it on staging as shown on the video from description |
|
@kavimuru correct, you have to do it from the testing account from oldDot from console on inbox page |
|
We need clearer instructions on step 2, when we create an account on OldDot we are redirected to NewDot and the Onboarding modal is present. bandicam.2024-09-17.14-16-40-845.mp4 |
|
@IuliiaHerets Oh right, when you use a public domain like gmail.com in your email you are automatically redirected to NewDot and the onboarding modal should be displayed. However that's not the case when it’s a new user logging on private domain like @expensify.com (or @swmansion.com) for example in OldDot, they would not be redirected and they would not get this NVP therefore modal would not be displayed when logging on NewDot. Does that clear things up? |
|
@blazejkustra We can use Gmail and @applause.expensifail.com accounts. With the @applause.expensifail.com account we don't have an Onboarding modal at all. |
When account was created on OldDot:
When account was created on NewDot, the modal should be displayed. I guess that should do it @IuliiaHerets |
|
Yes i think you will need to test by;
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.36-2 🚀
|
|
@blazejkustra This PR introduced this bug: #49404 It also breaks my PR #49092 |
|
@CyberAndrii Fix is on its way, no need for a revert |
Details
Link to thread on slack that explains the issue.
There are two issues currently:
nvp_onboardingisundefinedfor a second, because of the default false value here, the modal is displayed. Thenvp_onboardingis then updated to either:[](empty array) - modal disappears{ signupQualifier: whatever }- modal is still displayed as we are hitting the default value@vit
mentioned above,
nvp_onboardingcould be an object when transitioning from OldDot to NewDot if there are other values in the NVP such assignupQualifier(+hasCompletedGuidedSetupFlowisundefined). With the current default value the modal is shown, which isn't intended.Assuming we want to show the modal only for the users with the NVP where
hasCompletedGuidedSetupFlowis set tofalse. I think the easiest fix would be to change the default value in thehasCompletedGuidedSetupFlowSelectortotrue.In other words, the modal will be displayed only when the nvp is loaded and
hasCompletedGuidedSetupFlow===falseFixed Issues
$ #49245
PROPOSAL: N/A
Tests
nvp_onboardingon OldDot with this snippetNVP.set('onboarding', VALUE), do it in the OldDot console. (different values to test are:{},{test: true},{hasCompletedGuidedSetupFlow:true},{hasCompletedGuidedSetupFlow:false},null)Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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 so 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
MacOS: Chrome / Safari
test.1.mov