Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.52k stars 2.88k forks source link

[HOLD for payment 2024-08-19] [$250] Sign in – Onboarding modal is missing in new tab #47054

Closed IuliiaHerets closed 2 months ago

IuliiaHerets commented 3 months ago

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: v.9.0.18-1 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers): ponikarchuks+98824@gmail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. In Sign in page enter new Gmail account
  3. When Onboarding modal appears open new tab and paste https://staging.new.expensify.com/

Expected Result:

Onboarding modal is present in new tab

Actual Result:

Onboarding modal is missing in new tab

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/6395e2b1-0d6e-43a8-9ff1-5d09d2c76df5

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f33db55519f8fc02
  • Upwork Job ID: 1821535504288913507
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • ishpaul777 | Contributor | 103468942
Issue OwnerCurrent Issue Owner: @trjExpensify
melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

Triggered auto assignment to @NikkiWines (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

github-actions[bot] commented 3 months ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
IuliiaHerets commented 3 months ago

We think that this bug might be related to #vip-vsb

trjExpensify commented 3 months ago

So strange. Can't reproduce with private domain, can reproduce with public domain:

https://github.com/user-attachments/assets/49aa21f4-5adc-4145-9ffb-cd32a89cfb94

melvin-bot[bot] commented 3 months ago

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

trjExpensify commented 3 months ago

Let's get some eyes on it.

melvin-bot[bot] commented 3 months ago

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

NikkiWines commented 3 months ago

Might be related to https://github.com/Expensify/App/pull/46750/ since it changes when/why we show the onboarding modal, will try to reproduce locally now

dominictb commented 3 months ago

Proposal

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

Onboarding modal is missing in new tab

What is the root cause of that problem?

When we open a new tab, the isOnboardingFlowStatusKnownPromise promise reset after we call isOnboardingFlowCompleted here

https://github.com/Expensify/App/blob/d7b0aba10b580b7b8adebb3cdb2a8026f119dafa/src/libs/actions/Welcome.ts#L178-L180

Screenshot 2024-08-08 at 20 58 38

Then it will never be triggered to open the the onboarding modal.

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

We should only use resolveOnboardingFlowStatus to resolve isOnboardingFlowStatusKnownPromise promise when the onboarding is ready to use.

let resolveOnboardingFlowStatus: () => void;
let isOnboardingFlowStatusKnownPromise = new Promise<void>((resolve) => {
    resolveOnboardingFlowStatus = resolve;
});

We will create a global variable onboarding to store the onboarding data

let onboarding: Onboarding | undefined | [];
Onyx.connect({
    key: ONYXKEYS.NVP_ONBOARDING,
    callback: (value) => {
        if (value === undefined) {
            return;
        }
        if (onboarding === undefined) {
            onboarding = value;
            resolveOnboardingFlowStatus();
        } else {
            onboarding = value;
        }
    },
});

and then use it here

isOnboardingFlowStatusKnownPromise.then(() => {

What alternative solutions did you explore? (Optional)

NA

Result

https://github.com/user-attachments/assets/63208612-399d-49af-afb4-c54dcb3d0d86

dominictb commented 3 months ago

@NikkiWines I can raise a PR to fix the issue ASAP.

jayeshmangwani commented 3 months ago

When we open a new tab, the isOnboardingFlowStatusKnownPromise promise reset after we call isOnboardingFlowCompleted here

@dominictb I don't think this is the root cause. The issue is happening on staging and not in production, so any recent PR may have caused this problem.

dominictb commented 3 months ago

@jayeshmangwani We resolved the promise and then reset it here. Then if isOnboardingFlowCompleted is called after the promise resets, it never triggers because the onboarding in Onyx doesn't change again.

https://github.com/Expensify/App/blob/d7b0aba10b580b7b8adebb3cdb2a8026f119dafa/src/libs/actions/Welcome.ts#L177-L179

fedirjh commented 3 months ago

I don't think this is the root cause. The issue is happening on staging and not in production, so any recent PR may have caused this problem.

@jayeshmangwani The changes that @dominictb pointed out in his proposal are recently added in this PR, which is deployed to staging recently :

jayeshmangwani commented 3 months ago

@fedirjh I tested it after commenting out that code, and I'm still able to reproduce the issue. Have you tested to confirm that it's the cause of this bug?

jayeshmangwani commented 3 months ago

@jayeshmangwani The changes that @dominictb pointed out in his proposal are recently added in this PR, which is deployed to staging recently :

@fedirjh I've tested it a few times, but I'm not confident that those lines are the cause. Are you sure about this?

tushar-a-b commented 3 months ago

Hello, I am the author of PR #46750. I removed my changes and tried to reproduce the bug, and I can still reproduce it even without the changes from my PR.

dominictb commented 3 months ago

@jayeshmangwani Did you disable the strict mode?

fedirjh commented 3 months ago

@jayeshmangwani I just tested and the bug is fixed after reverting the changes and disabling strict mode.

jayeshmangwani commented 3 months ago

@jayeshmangwani Did you disable the strict mode?

No, let me try it by disabling it

jayeshmangwani commented 3 months ago

Thanks for the help, @dominictb and @fedirjh. Disabling the strict mode did the trick!

jayeshmangwani commented 3 months ago

@dominictb's Proposal will solve this issue.

Issue comes from this PR https://github.com/Expensify/App/pull/46559, that was merged recently and it is now in the regression period.

@NikkiWines What do you suggest? How should we proceed?

trjExpensify commented 3 months ago

We should get this back to the C+ and PR author if they're here to fix it, or revert that PR. @DylanDylann @nkdengineer

nkdengineer commented 3 months ago

I will raise a PR to fix this issue.

nkdengineer commented 3 months ago

@DylanDylann The PR is here.

NikkiWines commented 3 months ago

Yeah, ideally let's have this solved by the original PR author - though if we end up using the solution that was posted above, let's be sure to compensate @dominictb accordingly

marcaaron commented 3 months ago

Removing the DeployBlocker label as it looks like a frontend issue.

jayeshmangwani commented 2 months ago

I’m unassigning myself from this issue. @DylanDylann will be handling it

melvin-bot[bot] commented 2 months ago

⚠️ 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.

melvin-bot[bot] commented 2 months ago

📣 @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 📖

NikkiWines commented 2 months ago

@ishpaul777 reviewed, adding assingment

marcaaron commented 2 months ago

Fixed with a CP

dominictb commented 2 months ago

@NikkiWines Should I eligible for compenstation since this PR uses my proposal here?. The only difference is it creates a new function to resolve the onboarding promise.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

If no regressions arise, payment will be issued on 2024-08-19. :confetti_ball:

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

melvin-bot[bot] commented 2 months ago

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:

NikkiWines commented 2 months ago

@NikkiWines Should I eligible for compenstation since this https://github.com/Expensify/App/pull/47097 uses my proposal https://github.com/Expensify/App/issues/47054#issuecomment-2275970044?. The only difference is it creates a new function to resolve the onboarding promise.

@dominictb Yes, since the core logic used in the fix is the same, I think some compensation should be provided as the issue had been marked as external and help wanted at the time of your proposal being made. @trjExpensify what do you think?

trjExpensify commented 2 months ago

I think we can do a partial payment agreed, so when this comes around, I'll be sure to send an offer for $125.

ishpaul777 commented 2 months ago

Ready for payment 🎉

ishpaul777 commented 2 months ago

gentle bump @trjExpensify : )

melvin-bot[bot] commented 2 months ago

@trjExpensify, @NikkiWines, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

trjExpensify commented 2 months ago

Yup, I've been OoO. Payment summary as follows:

@ishpaul777 paid, @dominictb I've reached out to you for your Upwork profile.

trjExpensify commented 2 months ago

@dominictb offer now sent.

dominictb commented 2 months ago

@trjExpensify Offer accepted 🙏

trjExpensify commented 2 months ago

Paid, closing!