Skip to content
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

[HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again #43561

Closed
4 of 6 tasks
mountiny opened this issue Jun 12, 2024 · 33 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@mountiny
Copy link
Contributor

mountiny commented Jun 12, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @yuwenmemon
Slack conversation: internal https://expensify.slack.com/archives/C036QM0SLJK/p1718140438433339

Action Performed:

Break down in numbered steps

  1. Sign up with fresh new account
  2. Verify you can see the onboarding modal
  3. Refresh the browser tab

Expected Result:

Describe what you think should've happened

The onboarding modal is shown until you complete it, you cannot skip it

Actual Result:

Describe what actually happened

The onboarding modal was closed and does not show up again

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Kapture.2024-06-11.at.14.13.17.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b7cc757137685065
  • Upwork Job ID: 1800874213746714078
  • Last Price Increase: 2024-06-12
  • Automatic offers:
    • hungvu193 | Reviewer | 102710630
    • ishpaul777 | Contributor | 102710631
Issue OwnerCurrent Issue Owner: @johncschuster
@mountiny mountiny added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 12, 2024
@mountiny mountiny self-assigned this Jun 12, 2024
@melvin-bot melvin-bot bot changed the title [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again [$250] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01b7cc757137685065

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

Copy link

melvin-bot bot commented Jun 12, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @hungvu193 (External)

@mountiny mountiny changed the title [$250] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

Upwork job price has been updated to $500

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jun 12, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Refreshing the page with the onboarding flow closes it and never shows it again

What is the root cause of that problem?

In here we are deem hasCompletedGuidedSetupFlow to be true when its undefined.

selector: (onboarding) => !Array.isArray(onboarding) && (onboarding?.hasCompletedGuidedSetupFlow ?? true),

here we navigate if hasCompletedGuidedSetupFlow is true

useEffect(() => {
if (!hasCompletedGuidedSetupFlow) {
return;
}
Navigation.isNavigationReady().then(() => {
// Need to go back to previous route and then redirect to Concierge,
// otherwise going back on Concierge will go to onboarding and then redirected to Concierge again
Navigation.goBack();
Report.navigateToConciergeChat();
});
}, [hasCompletedGuidedSetupFlow]);

What changes do you think we should make in order to solve the problem?

we should not default hasCompletedGuidedSetupFlow to true, we need to update selector for hasCompletedGuidedSetupFlow like below, for old accounts NVP_ONBOARDING will be array so we consider hasCompletedGuidedSetupFlow to be true always.

const [hasCompletedGuidedSetupFlow] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
        selector: (onboarding) => {
            if (Array.isArray(onboarding)) {
                return true;
            }

            return onboarding?.hasCompletedGuidedSetupFlow;
        }
    });

selector: (onboarding) => !Array.isArray(onboarding) && (onboarding?.hasCompletedGuidedSetupFlow ?? true),

Video:

Screen.Recording.2024-06-12.at.6.58.28.PM.mov

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@cretadn22
Copy link
Contributor

cretadn22 commented Jun 12, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

What is the root cause of that problem?

We implement logic to hide the onboarding modal if users complete it

useEffect(() => {
if (!hasCompletedGuidedSetupFlow) {
return;
}
Navigation.isNavigationReady().then(() => {
// Need to go back to previous route and then redirect to Concierge,
// otherwise going back on Concierge will go to onboarding and then redirected to Concierge again
Navigation.goBack();

But we set default value for hasCompletedGuidedSetupFlow if the data in ONYX isn't available

const [hasCompletedGuidedSetupFlow] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
selector: (onboarding) => !Array.isArray(onboarding) && (onboarding?.hasCompletedGuidedSetupFlow ?? true),
});

What changes do you think we should make in order to solve the problem?

Navigation.isNavigationReady().then(() => {
// Need to go back to previous route and then redirect to Concierge,
// otherwise going back on Concierge will go to onboarding and then redirected to Concierge again
Navigation.goBack();
Report.navigateToConciergeChat();
});

Here, we'll navigate to the CentralPaneNavigator. Then, I propose implementing a logic to redirect to the onboarding modal if the hasCompletedGuidedSetupFlow is false (after the onyx field is available)

Let's add this logic in the BaseCentralPaneNavigator.

    const [hasCompletedGuidedSetupFlow] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
        selector: (onboarding) => !Array.isArray(onboarding) && (onboarding?.hasCompletedGuidedSetupFlow ?? true),
    });
  
    useEffect(() => {
            if (!hasCompletedGuidedSetupFlow) {
                Navigation.navigate(ROUTES.ONBOARDING_PURPOSE);
            }
    
    }, [hasCompletedGuidedSetupFlow]);

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@ishpaul777
Copy link
Contributor

this was a close one @cretadn22 😃

@hungvu193
Copy link
Contributor

We can go with @ishpaul777 's proposal

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 12, 2024

Current assignee @mountiny is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@cretadn22
Copy link
Contributor

Both proposal is posted in the same time. @hungvu193 Should we split payment for me and @ishpaul777 and I will create PR for this one? It will be a more harmonious for both. @ishpaul777 What do you think about this suggestion?

@mountiny
Copy link
Contributor Author

@ishpaul777 if we do your changes, the onboarding flow will show up for old accounts or accounts created in Olddot. They do not have the onboarding?.hasCompletedGuidedSetupFlow defined and we should not show them the onboarding flow

@hungvu193
Copy link
Contributor

What's its default value for new account? If it's false then we can add an extra condition to handle that case.

@cretadn22

This comment was marked as off-topic.

@cretadn22
Copy link
Contributor

@hungvu193
Copy link
Contributor

I'm having trouble while testing account that was created from old dot. I'll try again in a while...

Screen.Recording.2024-06-12.at.22.21.17.mov

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jun 12, 2024

@mountiny sorry for delay. here it says that old accounts have the array for nvp_onboarding and i tested that for olddot it is also a array so it works just fine 🤔

App/src/ONYXKEYS.ts

Lines 599 to 600 in 06bdf11

// NVP_ONBOARDING is an array for old users.
[ONYXKEYS.NVP_ONBOARDING]: Onboarding | [];

we have this !Array.isArray(onboarding) which will prevent it for opening for those accounts

selector: (onboarding) => !Array.isArray(onboarding) && (onboarding?.hasCompletedGuidedSetupFlow ?? true),

@hungvu193
Copy link
Contributor

With old account, !Array.isArray(onboarding) is true and onboarding?.hasCompletedGuideSetupFlow will be false if we remove ?? true.
So it will make hasCompletedGuideSetupFlow return false and popup will open.

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jun 12, 2024

Ah i got it! then we can just change this condition like below:

const [hasCompletedGuidedSetupFlow] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {
        selector: (onboarding) => {
            if (Array.isArray(onboarding)) {
                return true;
            }

            return onboarding?.hasCompletedGuidedSetupFlow;
        }
    });

New Account:

Screen.Recording.2024-06-12.at.10.08.53.PM.mov

Old Account:

Screen.Recording.2024-06-12.at.10.12.35.PM.mov

@ishpaul777
Copy link
Contributor

@hungvu193 I have updated my proposal

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 12, 2024

📣 @hungvu193 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jun 12, 2024

📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor Author

@ishpaul777 alright, I think that works, please raise the pr when you can, thanks

@ishpaul777
Copy link
Contributor

Thanks for assigning Vit, I'll raise a Pr in ~2 hours

@ishpaul777
Copy link
Contributor

@hungvu193 PR ^ is ready for your review!

@hungvu193
Copy link
Contributor

Cool. I'll review it today

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 17, 2024
@melvin-bot melvin-bot bot changed the title [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again [HOLD for payment 2024-06-24] [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again Jun 17, 2024
Copy link

melvin-bot bot commented Jun 17, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 17, 2024
Copy link

melvin-bot bot commented Jun 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.84-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-06-24. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 17, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@hungvu193 / @ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
  • [@hungvu193 / @ishpaul777] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@hungvu193 / @ishpaul777] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@hungvu193 / @ishpaul777] Determine if we should create a regression test for this bug.
  • [@hungvu193 / @ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-06-24] [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again [HOLD for payment 2024-06-28] [HOLD for payment 2024-06-24] [$500] [Guided Setup] Refreshing the page with the onboarding flow closes it and never shows it again Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.85-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-06-28. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jun 21, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@hungvu193 / @ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
  • [@hungvu193 / @ishpaul777] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@hungvu193 / @ishpaul777] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@hungvu193 / @ishpaul777] Determine if we should create a regression test for this bug.
  • [@hungvu193 / @ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@johncschuster] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@johncschuster
Copy link
Contributor

@hungvu193 / @ishpaul777 can you address the BZ Checklist when you get a moment? Thank you!

@hungvu193
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: https://github.com/Expensify/App/pull/42087/files
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: https://github.com/Expensify/App/pull/42087/files#r1651206632
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • Determine if we should create a regression test for this bug: Yes

Regression test:

  1. Sign up with fresh new account.
  2. Verify you can see the onboarding modal.
  3. Refresh the browser tab.
  4. Verify that on boarding modal will show up.

Do we 👍 or 👎 ?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 24, 2024
@johncschuster
Copy link
Contributor

Payment has been issued. Thanks for your contributions! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants