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

[$250] Fix onboarding modal in macOS Chrome/Safari #53724

Closed
carlosmiceli opened this issue Dec 6, 2024 · 20 comments
Closed

[$250] Fix onboarding modal in macOS Chrome/Safari #53724

carlosmiceli opened this issue Dec 6, 2024 · 20 comments
Assignees
Labels
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

@carlosmiceli
Copy link
Contributor

carlosmiceli commented Dec 6, 2024

The onboarding modal seems to have issues being displayed in macOS in Chrome and Safari (conversation, GH comment). Seems like there is an issue with screen size and/or refresh. Please fix it and ensure it's always displayed in all possible platforms. We found this while working on this issue: #53326

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021865160679237341916
  • Upwork Job ID: 1865160679237341916
  • Last Price Increase: 2024-12-06
Issue OwnerCurrent Issue Owner: @hungvu193
@carlosmiceli carlosmiceli added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 6, 2024
@carlosmiceli carlosmiceli self-assigned this Dec 6, 2024
Copy link

melvin-bot bot commented Dec 6, 2024

Triggered auto assignment to @slafortune (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.

@carlosmiceli carlosmiceli added the External Added to denote the issue can be worked on by a contributor label Dec 6, 2024
@melvin-bot melvin-bot bot changed the title Fix onboarding modal in macOS Chrome/Safari [$250] Fix onboarding modal in macOS Chrome/Safari Dec 6, 2024
Copy link

melvin-bot bot commented Dec 6, 2024

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

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

melvin-bot bot commented Dec 6, 2024

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

@Shahidullah-Muffakir
Copy link
Contributor

Coming from #53326 (comment). I’ll work on this, thanks!

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

melvin-bot bot commented Dec 7, 2024

📣 @Shahidullah-Muffakir You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@Shahidullah-Muffakir
Copy link
Contributor

@carlosmiceli as per #53284 (comment) and after testing with same steps, the onboarding modal works as expected in staging when signing up through staging.expensify.com, after redirecting to staging.new.expensify.com the onboarding flow modal appears as expected. However, the issue persists in prod.
Considering this, should we wait for the next production deploy to see if the issue resolves? Thank you.

@carlosmiceli
Copy link
Contributor Author

should we wait for the next production deploy to see if the issue resolves?

Yes, that sounds like a good idea.

@melvin-bot melvin-bot bot added the Overdue label Dec 9, 2024
@carlosmiceli
Copy link
Contributor Author

Not overdue.

@carlosmiceli carlosmiceli added Daily KSv2 and removed Daily KSv2 labels Dec 9, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

@carlosmiceli, @slafortune, @hungvu193, @Shahidullah-Muffakir Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Dec 13, 2024
@carlosmiceli
Copy link
Contributor Author

Still discussing details in the PR.

@carlosmiceli carlosmiceli added Weekly KSv2 and removed Daily KSv2 labels Dec 13, 2024
@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2024
@carlosmiceli carlosmiceli removed the Weekly KSv2 label Dec 13, 2024
@carlosmiceli
Copy link
Contributor Author

@Shahidullah-Muffakir is this still occurring?

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
Copy link

melvin-bot bot commented Dec 17, 2024

@carlosmiceli, @slafortune, @hungvu193, @Shahidullah-Muffakir Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@hungvu193
Copy link
Contributor

little bump @Shahidullah-Muffakir

@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
@Shahidullah-Muffakir
Copy link
Contributor

@Shahidullah-Muffakir is this still occurring?

Yes, still occurring.

@Shahidullah-Muffakir
Copy link
Contributor

little bump @Shahidullah-Muffakir

PR will be ready by tomorrow.

@Shahidullah-Muffakir
Copy link
Contributor

Proposal

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

Fix onboarding modal in macOS Chrome/Safari.

What is the root cause of that problem?

  1. In the hasCompletedGuidedSetupFlowSelector function, when the onboardingFlow object is empty or hasCompletedGuidedSetupFlowSelector is undefined, we are returning true:
    if (Array.isArray(onboarding) || isEmptyObject(onboarding)) {
    return true;
    }
    if (!isEmptyObject(onboarding) && onboarding?.hasCompletedGuidedSetupFlow === undefined) {
    return true;
    }
  2. This results in the useOnboardingFlowRouter hook returning true:
    const {isOnboardingCompleted} = useOnboardingFlowRouter();

    and as the isOnboardingCompleted is true, this condition fails:
    {isOnboardingCompleted === false && (
    <RootStack.Screen
    name={NAVIGATORS.ONBOARDING_MODAL_NAVIGATOR}
    options={{...rootNavigatorOptions.basicModalNavigator, gestureEnabled: false}}
    component={OnboardingModalNavigator}

    Hence, the Onboarding Modal is not shown.

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

The same way we return false when the onboarding object is empty in the case of:

function hasSeenTourSelector(onboarding: OnyxValue<typeof ONYXKEYS.NVP_ONBOARDING>): boolean | undefined {
if (Array.isArray(onboarding) || isEmptyObject(onboarding)) {
return false;
}
,
we should return false in the case of hasCompletedGuidedSetupFlowSelector as well if the onboarding is undefined.
as:

function hasCompletedGuidedSetupFlowSelector(onboarding: OnyxValue<typeof ONYXKEYS.NVP_ONBOARDING>): boolean | undefined {
    // Onboarding is an empty object for old accounts and accounts migrated from OldDot
    if (Array.isArray(onboarding) || isEmptyObject(onboarding)) {
-         return true;
+        return false;
    }

    if (!isEmptyObject(onboarding) && onboarding?.hasCompletedGuidedSetupFlow === undefined) {
-        return true;
+       return false;
    }

@hungvu193 Before making the PR, could you review the changes I proposed, thanks.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

We need to updated these tests as well, to return false instead of true:

// It might be the case that backend returns an empty array if the NVP is not defined on this particular account
it('Should return true if onboarding NVP is an array', () => {
const onboarding = [] as OnyxValue<typeof ONYXKEYS.NVP_ONBOARDING>;
expect(hasCompletedGuidedSetupFlowSelector(onboarding)).toBe(true);
});
it('Should return true if onboarding NVP is an empty object', () => {
const onboarding = {} as OnyxValue<typeof ONYXKEYS.NVP_ONBOARDING>;
expect(hasCompletedGuidedSetupFlowSelector(onboarding)).toBe(true);
});
it('Should return true if onboarding NVP contains only signupQualifier', () => {
const onboarding = {signupQualifier: CONST.ONBOARDING_SIGNUP_QUALIFIERS.VSB} as OnyxValue<typeof ONYXKEYS.NVP_ONBOARDING>;
expect(hasCompletedGuidedSetupFlowSelector(onboarding)).toBe(true);
});

Copy link

melvin-bot bot commented Dec 18, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny
Copy link
Contributor

@Shahidullah-Muffakir We cannot return false there, its intentional that we do not show the onboarding modal for users that do not have the nvp or of the nvp is an empty object

@Shahidullah-Muffakir
Copy link
Contributor

We cannot return false there, its intentional that we do not show the onboarding modal for users that do not have the nvp or of the nvp is an empty object

Got it. Thanks for confirming

@mountiny
Copy link
Contributor

Lets close this in favour of #54322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
None yet
Development

No branches or pull requests

5 participants