Skip to content

[Due for payment 2025-03-31] [$250] Onboarding modal is shown to the user on creating workspace. #57499

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

Closed
1 of 8 tasks
m-natarajan opened this issue Feb 26, 2025 · 52 comments
Closed
1 of 8 tasks
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 Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause

Comments

@m-natarajan
Copy link

m-natarajan commented Feb 26, 2025

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number:
Reproducible in staging?: Needs Reproduction
Reproducible in production?: Needs Reproduction
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @parasharrajat
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Create workspace.
    (Not sure of the exact step to reproduce this,
    and don't know the criteria for this error)

Expected Result:

User should not be shown to onboarding

Actual Result:

When workspace creation fails, with following error, User is shown onboarding and other errors.

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: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
26.02.2025_19.50.48_REC.mp4

Image

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021895143770861093886
  • Upwork Job ID: 1895143770861093886
  • Last Price Increase: 2025-03-13
  • Automatic offers:
    • mkzie2 | Contributor | 106590420
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @maddylewis
@m-natarajan m-natarajan added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause labels Feb 26, 2025
Copy link

melvin-bot bot commented Feb 26, 2025

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

@MelvinBot
Copy link

This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989

@parasharrajat
Copy link
Member

I can reproduce this on my account and I am C+.

@ChavdaSachin
Copy link
Contributor

Hey @parasharrajat by any chance did you checked the status of nvp_onboarding.hasCompletedGuidedSetupFlow flag?
I am trying to understand here if it was a FE problem or BE.
Thank you.

@parasharrajat
Copy link
Member

Its' frontend issue.

@parasharrajat
Copy link
Member

@alexpensify I can reproduce this issue, please assign me as C+.

@alexpensify alexpensify added the External Added to denote the issue can be worked on by a contributor label Feb 27, 2025
Copy link

melvin-bot bot commented Feb 27, 2025

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

@melvin-bot melvin-bot bot changed the title Onboarding modal is shown to the user on creating workspace. [$250] Onboarding modal is shown to the user on creating workspace. Feb 27, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 27, 2025
Copy link

melvin-bot bot commented Feb 27, 2025

Current assignee @parasharrajat is eligible for the External assigner, not assigning anyone new.

@alexpensify
Copy link
Contributor

@parasharrajat - Thanks for the update!

@parasharrajat
Copy link
Member

Anyone trying to reproduce this, fail the workspace creation with an error and error code 666. It should show you this state. This issue seems to have originated from #56141

@huult
Copy link
Contributor

huult commented Mar 1, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-03-01 16:09:32 UTC.

Proposal

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

Onboarding modal is shown to the user on creating workspace.

What is the root cause of that problem?

In this case, when we create a new workspace, it returns error code 666, and the failure data includes setting hasCompletedGuidedSetupFlow to false in the key NVP_ONBOARDING.

App/src/libs/actions/Report.ts

Lines 4043 to 4049 in e4c22ec

if (!wasInvited) {
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: false},
});
}

Image

And why was hasCompletedGuidedSetupFlow: false added to the failure data? Because when we called prepareOnboardingOnyxData, we didn't set the wasInvited parameter for it. So when workspace creation fails, hasCompletedGuidedSetupFlow is always updated to false.

const onboardingData = ReportUtils.prepareOnboardingOnyxData(engagementChoice, CONST.ONBOARDING_MESSAGES[engagementChoice], adminsChatReportID, policyID);

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

To resolve this issue, we should set wasInvited to the current NVP_ONBOARDING value in prepareOnboardingOnyxData to implement something like this:

  1. Get current NVP_ONBOARDING value

add:

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({
    key: ONYXKEYS.NVP_ONBOARDING,
    callback: (value) => (onboarding = value),
});
  1. Set the wasInvited parameter for prepareOnboardingOnyxData using the onboarding parameter to determine whether hasCompletedGuidedSetupFlow is true on success or false on failure

const onboardingData = ReportUtils.prepareOnboardingOnyxData(engagementChoice, CONST.ONBOARDING_MESSAGES[engagementChoice], adminsChatReportID, policyID);

update to:

    const onboardingData = ReportUtils.prepareOnboardingOnyxData(
        engagementChoice,
        CONST.ONBOARDING_MESSAGES[engagementChoice],
        adminsChatReportID,
        policyID,
        undefined,
        onboarding?.hasCompletedGuidedSetupFlow,
    );
Screen.Recording.2025-03-01.at.23.02.38.mov

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

None

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.

@parasharrajat
Copy link
Member

@huult If you look closely, there are errors behind the onboarding modal for sent messages on concierge chat. Can you add a fix for that, too? I forgot to mention that during the error reporting.

@huult
Copy link
Contributor

huult commented Mar 2, 2025

@parasharrajat yes

@huult
Copy link
Contributor

huult commented Mar 2, 2025

Screen.Recording.2025-03-02.at.07.47.49.mov

@parasharrajat Were you able to reproduce the issue of the error binding the onboarding modal for sent messages in the Concierge chat?

@parasharrajat
Copy link
Member

I didn't understand your question. I was able to to reproduce thus issue as shown in the attached video in OP.

@huult
Copy link
Contributor

huult commented Mar 3, 2025

@parasharrajat Because I didn't encounter an error in the Concierge chat on my side, and the expected result was not mentioned to them. I think it's out of scope.

@mkzie2
Copy link
Contributor

mkzie2 commented Mar 3, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-03-03 08:54:12 UTC.

Proposal

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

When workspace creation fails, with following error, User is shown onboarding and other errors.

What is the root cause of that problem?

For the first created workspace or the old user, we will send guidedSetupData and add the task data to the concierge chat or admin room.

if (!introSelected?.createWorkspace && engagementChoice && shouldAddOnboardingTasks) {
const onboardingData = ReportUtils.prepareOnboardingOnyxData(engagementChoice, CONST.ONBOARDING_MESSAGES[engagementChoice], adminsChatReportID, policyID);
if (!onboardingData) {
return {successData, optimisticData, failureData, params};
}
const {guidedSetupData, optimisticData: taskOptimisticData, successData: taskSuccessData, failureData: taskFailureData} = onboardingData;
params.guidedSetupData = JSON.stringify(guidedSetupData);

App/src/libs/actions/Report.ts

Lines 3965 to 3970 in a018b5f

if (!wasInvited) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: true},
});

If the API fails, we have the logic here to update hasCompletedGuidedSetupFlow to false, then the onboarding modal is shown.

App/src/libs/actions/Report.ts

Lines 4035 to 4039 in a018b5f

if (!wasInvited) {
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: false},

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

We should only update hasCompletedGuidedSetupFlow in optimistic data and failure data if onboarding.hasCompletedGuidedSetupFlow is false, that is how we're checking here.

if (!wasInvited && onboarding?.hasCompletedGuidedSetupFlow === false) {

App/src/libs/actions/Report.ts

Lines 3965 to 3970 in a018b5f

if (!wasInvited) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: true},
});

if (!wasInvited && onboarding?.hasCompletedGuidedSetupFlow === false) {

App/src/libs/actions/Report.ts

Lines 4035 to 4039 in a018b5f

if (!wasInvited) {
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: false},

We shouldn't pass wasInvited as onboarding.hasCompletedGuidedSetupFlow here because:

  • wasInvited means the user is an invited user or not
  • prepareOnboardingOnyxData is also used in other places, so using onboarding.hasCompletedGuidedSetupFlow in prepareOnboardingOnyxData can also fix for other places if it has the same problem.

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

Updated the test case we created here with the case hasCompletedGuidedSetupFlow is true and the API fails. Verify that the hasCompletedGuidedSetupFlow isn't updated to false.

there are errors behind the onboarding modal for sent messages on concierge chat

For this bug, because we have guidedSetupData sent to the API, there are some tasks that will be created in the concierge chat. So it's expected that the errors appear if the API falis.

What alternative solutions did you explore? (Optional)

Instead of updating the hasCompletedGuidedSetupFlow, we should update this to the current value in onboarding object

if (!wasInvited) {
    failureData.push({
        onyxMethod: Onyx.METHOD.MERGE,
        key: ONYXKEYS.NVP_ONBOARDING,
        value: {hasCompletedGuidedSetupFlow: onboarding.hasCompletedGuidedSetupFlow ?? null},
    });
}

App/src/libs/actions/Report.ts

Lines 4035 to 4039 in a018b5f

if (!wasInvited) {
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.NVP_ONBOARDING,
value: {hasCompletedGuidedSetupFlow: false},

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.

@huult
Copy link
Contributor

huult commented Mar 3, 2025

Note C+:

  • The other proposal still uses onboarding?.hasCompletedGuidedSetupFlow to check and prevent NVP_ONBOARDING data, which is the same as my approach, but the only difference is that it is used elsewhere.

@parasharrajat
Copy link
Member

Let me make it clear that the expected behaviour is

  1. Fix the onboarding modal being shown.
  2. Fix the errors reported in the concierge chats.

Can we please update this @alexpensify in the OP.

@parasharrajat
Copy link
Member

Please mention if you were able to reproduce this issue or not, share a screenshot as well. @huult @mkzie2

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Mar 20, 2025
@mkzie2
Copy link
Contributor

mkzie2 commented Mar 20, 2025

@parasharrajat The PR is ready.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 24, 2025
@melvin-bot melvin-bot bot changed the title [$250] Onboarding modal is shown to the user on creating workspace. [Due for payment 2025-03-31] [$250] Onboarding modal is shown to the user on creating workspace. Mar 24, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 24, 2025
Copy link

melvin-bot bot commented Mar 24, 2025

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

Copy link

melvin-bot bot commented Mar 24, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.17-1 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 2025-03-31. 🎊

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

Copy link

melvin-bot bot commented Mar 24, 2025

@parasharrajat @alexpensify @parasharrajat The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Third week)

@alexpensify alexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Mar 28, 2025
Copy link

melvin-bot bot commented Mar 28, 2025

Triggered auto assignment to @maddylewis (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 melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 28, 2025
@alexpensify alexpensify removed the Daily KSv2 label Mar 28, 2025
@alexpensify
Copy link
Contributor

🚨 Heads up! I'll be offline until Monday, April 7, 2025, and won’t be actively monitoring this GitHub during that time.

@maddylewis, I went ahead and reassigned this one since the payment date is next week, and I’ll be offline. I appreciate your help with the required action here. Thanks!

@alexpensify alexpensify added the Weekly KSv2 label Mar 28, 2025
@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Mar 31, 2025
@parasharrajat
Copy link
Member

parasharrajat commented Apr 2, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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/56141/files#r2024881814

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not needed

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • New Workspace creation is restricted by any reason possible such as limits imposed on account.

Test:

  1. Sign in to a new account
  2. Complete the onboarding flow with a purpose that isn't Manage my team.
  3. Try to create a new workspace and wait for the backend to show creation failure with an error.
  4. Verify that the onboarding modal is not shown after the error.

Do we agree 👍 or 👎

@maddylewis
Copy link
Contributor

maddylewis commented Apr 2, 2025

Summary:

@melvin-bot melvin-bot bot removed the Overdue label Apr 2, 2025
@parasharrajat
Copy link
Member

Payment requested as per #57499 (comment)

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 Needs Reproduction Reproducible steps needed retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause
Projects
None yet
Development

No branches or pull requests

10 participants