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.58k stars 2.92k forks source link

[$250] User lands on concierge instead of the LHN #52420

Open m-natarajan opened 2 weeks ago

m-natarajan commented 2 weeks 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: 9.0.60-1 Reproducible in staging?: y Reproducible in production?: y 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: @shawnborton Slack conversation (hyperlinked to channel name): [expensify_convert] (https://expensify-ts.slack.com/archives/C07HPDRELLD/p1731430243357459)

Action Performed:

  1. Sign up for new account in mobile device
  2. Complete onboarding

    Expected Result:

    User lands in LHN

    Actual Result:

    User lands in Concierge

    Workaround:

    unknown

    Platforms:

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

    • [x] Android: Standalone
    • [x] Android: HybridApp
    • [x] Android: mWeb Chrome
    • [x] iOS: Standalone
    • [x] iOS: HybridApp
    • [ ] iOS: mWeb Safari
    • [ ] MacOS: Chrome / Safari
    • [ ] MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021857485391551648841
  • Upwork Job ID: 1857485391551648841
  • Last Price Increase: 2024-11-22
Issue OwnerCurrent Issue Owner: @mollfpr
melvin-bot[bot] commented 2 weeks ago

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

Nodebrute commented 2 weeks ago

Proposal

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

User lands on concierge instead of the LHN

What is the root cause of that problem?

from here we get lastAccessedReport https://github.com/Expensify/App/blob/dc1e79ddca73eed372f52b346a9ff4802d47ec4f/src/libs/navigateAfterOnboarding.ts#L24 and then in here, we navigate to it https://github.com/Expensify/App/blob/dc1e79ddca73eed372f52b346a9ff4802d47ec4f/src/libs/navigateAfterOnboarding.ts#L37

The problem is the findLastAccessedReport function will return the concierge report as the last accessed report.

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

To exclude it, we can pass conciergeChatReportID as the fourth parameter here, ensuring we always navigate to the LHN, except in cases where the public room was opened first. https://github.com/Expensify/App/blob/dc1e79ddca73eed372f52b346a9ff4802d47ec4f/src/libs/navigateAfterOnboarding.ts#L24

We can retrieve the concierge ID either by passing it as a prop or by implementing something like this

let conciergeChatReportID: string | undefined;
Onyx.connect({
    key: ONYXKEYS.CONCIERGE_REPORT_ID,
    callback: (value) => (conciergeChatReportID = value),
});

What alternative solutions did you explore? (Optional)

Shahidullah-Muffakir commented 2 weeks ago

Based on this issue, https://github.com/Expensify/App/issues/52018 there seems to be an inconsistency regarding the expected behavior of where a user should land after completing onboarding

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

MitchExpensify commented 2 weeks ago

The expected bahevior is to land in LHN

mkzie2 commented 2 weeks ago

Edited by proposal-police: This proposal was edited at 2024-11-26 09:13:08 UTC.

Proposal

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

In Step 5, user is redirected to LHN after completing onboarding when "Manage my team's expenses" is selected.

What is the root cause of that problem?

If we select Manage team's expenses, a WS and a WS chat are created

https://github.com/Expensify/App/blob/67784196d8b2ec3621aff6b5fe4007f6be7c07e8/src/pages/OnboardingAccounting/BaseOnboardingAccounting.tsx#L154

Then lastAccessedReport is the WS chat of the onboarding policy. In the small screen, shouldUseNarrowLayout is true so the user lands on LHN

https://github.com/Expensify/App/blob/67784196d8b2ec3621aff6b5fe4007f6be7c07e8/src/libs/navigateAfterOnboarding.ts#L27-L35

If we select another purpose, the lastAccessedReport is the concierge chat so the user lands in the concierge chat

https://github.com/Expensify/App/blob/67784196d8b2ec3621aff6b5fe4007f6be7c07e8/src/libs/navigateAfterOnboarding.ts#L37

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

We should return early here if the lastAccessedReport is the concierge. So this will only move to the lastAccessedReport in case we sign in with a public room.

if (ReportUtils.isConciergeChatReport(lastAccessedReport)) {
    return;
}

https://github.com/Expensify/App/blob/664f8261b585b89b7b2b5d677b5bcdd4293e4444/src/libs/navigateAfterOnboarding.ts#L36

Optional: Another thing, we already return early if isSmallScreenWidth is false here

https://github.com/Expensify/App/blob/664f8261b585b89b7b2b5d677b5bcdd4293e4444/src/libs/navigateAfterOnboarding.ts#L20

And if isSmallScreenWidth is true, shouldUseNarrowLayout is always true and this condition is always false so we can remove this block. https://github.com/Expensify/App/blob/664f8261b585b89b7b2b5d677b5bcdd4293e4444/src/libs/navigateAfterOnboarding.ts#L30-L32

If we want to do that we can merge ReportUtils.isConciergeChatReport(lastAccessedReport) to this line. After all, we can have a cleaner function like this

Navigation.dismissModal();

// When hasCompletedGuidedSetupFlow is true, OnboardingModalNavigator in AuthScreen is removed from the navigation stack.
// On small screens, this removal redirects navigation to HOME. Dismissing the modal doesn't work properly,
// so we need to specifically navigate to the last accessed report.
if (!isSmallScreenWidth) {
    return;
}

const lastAccessedReport = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom(), activeWorkspaceID);
const lastAccessedReportID = lastAccessedReport?.reportID;
// we don't want to navigate to newly creaded workspace after onboarding completed.
if (!lastAccessedReportID || lastAccessedReport.policyID === onboardingPolicyID || ReportUtils.isConciergeChatReport(lastAccessedReport)) {
    return;
}

const lastAccessedReportRoute = ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? '-1');
Navigation.navigate(lastAccessedReportRoute);

What alternative solutions did you explore? (Optional)

mkzie2 commented 2 weeks ago

I created a proposal in this issue https://github.com/Expensify/App/issues/52018 and bring it here since it's the same issue.

danielrvidal commented 1 week ago

@mollfpr any thoughts on which proposal to go with?

mollfpr commented 1 week ago

The expected bahevior is to land in LHN

@MitchExpensify @danielrvidal For clarification could you list the expected in the below purposes whether LHN or Concierge?

  1. Track and budget expense:
  2. Manage my team's expense:
  3. Get paid back by my employer:
  4. Chat and split expenses with friends:
  5. Something else:
MitchExpensify commented 1 week ago

Its the same (LHN) for all, right @danielrvidal ?

mkzie2 commented 1 week ago

I think we should navigate to the concierge chat for all cases because we can have some tasks created in the concierge chat from the onboarding flow. Then the user can see the task after the onboarding flow if we navigate to the concierge chat.

cc @danielrvidal

mollfpr commented 1 week ago

I think we should navigate to the concierge chat for all cases because we can have some tasks created in the concierge chat from the onboarding flow.

@mkzie2 Interesting, but the flow for "Something else" doesn't create tasks in the concierge, why do we need to navigate to the concierge in that case?

mkzie2 commented 1 week ago

@mollfpr We want to be consistent for all onboarding flow so I suggest navigating to the concierge chat with the reason above.

Nodebrute commented 1 week ago

The expected bahevior is to land in LHN

@mollfpr The expected result is that the user should land on the LHN. The previous issue (https://github.com/Expensify/App/issues/52018) was closed because the expected result provided at the time was incorrect.

melvin-bot[bot] commented 1 week ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

danielrvidal commented 6 days ago

Yea, we want them to land on the inbox in the LHN rather than in the concierge DM because it's the home screen. We have a tooltip and GBR that direct them to go to the Concierge chat next.

Shahidullah-Muffakir commented 6 days ago

Edited by proposal-police: This proposal was edited at 2024-11-24 18:13:44 UTC.

Proposal

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

After the onboarding flow , user lands on the Concierge chat, instead of inbox or home page.

What is the root cause of that problem?

here: https://github.com/Expensify/App/blob/67784196d8b2ec3621aff6b5fe4007f6be7c07e8/src/libs/navigateAfterOnboarding.ts#L37

we are navigating to the last accessed report.

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

based on: https://github.com/Expensify/App/issues/52420#issuecomment-2489751301 and https://github.com/Expensify/App/issues/52420#issuecomment-2496132484

it seems, here: https://github.com/Expensify/App/blob/67784196d8b2ec3621aff6b5fe4007f6be7c07e8/src/libs/navigateAfterOnboarding.ts#L37

we can simply write: Navigation.navigate(ROUTES.HOME);

What alternative solutions did you explore? (Optional)

I think we can totally replace these two lines: https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/pages/OnboardingAccounting/BaseOnboardingAccounting.tsx#L172 and https://github.com/Expensify/App/blob/f4f8da74c100f2c5ddb666ff4314038010104cbf/src/pages/OnboardingPersonalDetails/BaseOnboardingPersonalDetails.tsx#L75

with

   Navigation.dismissModal();
    Navigation.navigate(ROUTES.HOME);
MitchExpensify commented 4 days ago

What do you think about the latest proposal @mollfpr ?

melvin-bot[bot] commented 4 days ago

@mollfpr @MitchExpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

mkzie2 commented 4 days ago

Updated proposal.

melvin-bot[bot] commented 4 days ago

@mollfpr, @MitchExpensify Huh... This is 4 days overdue. Who can take care of this?

mollfpr commented 4 days ago

Thank you guys for the proposals!

we are navigating to the last accessed report.

@Shahidullah-Muffakir Your RCA doesn't have much explanation, and your solution will not work with sign in from deeplink.


So to conclude, the solution from @Nodebrute and @mkzie2 has the same which to avoid navigating to the concierge chat report. The solution from @Nodebrute needs access to Onyx to get the concierge reportID so it needs more lines of code to define the Onyx value and add more parameters to the function, but the @mkzie2 solution only needs to check whether the lastAccessedReport is concierge chat and return early. So I suggest we go with @mkzie2 solution because the changes is straight forward.

🎀 👀 🎀 C+ reviewed!

melvin-bot[bot] commented 4 days ago

Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 4 days ago

❌ There was an error making the offer to @mkzie2 for the Contributor role. The BZ member will need to manually hire the contributor.

MitchExpensify commented 3 days ago

@mkzie2 what is your Upwork profile?

mkzie2 commented 3 days ago

@MitchExpensify It's https://www.upwork.com/freelancers/~019f73367b03c6d784

MitchExpensify commented 3 days ago

Thanks, offer sent @mkzie2 !

mkzie2 commented 2 days ago

@mollfpr The PR is ready.