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] User lands on concierge instead of the LHN #52420

Open
5 of 8 tasks
m-natarajan opened this issue Nov 12, 2024 · 33 comments
Open
5 of 8 tasks

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

m-natarajan opened this issue Nov 12, 2024 · 33 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Nov 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: 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?

  • 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

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: @mkzie2
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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
Copy link
Contributor

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

const lastAccessedReport = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom(), activeWorkspaceID);

and then in here, we navigate to it
Navigation.navigate(lastAccessedReportRoute);

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.

const lastAccessedReport = ReportUtils.findLastAccessedReport(!canUseDefaultRooms, shouldOpenOnAdminRoom(), activeWorkspaceID);

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
Copy link
Contributor

Based on this issue, #52018
there seems to be an inconsistency regarding the expected behavior of where a user should land after completing onboarding

@melvin-bot melvin-bot bot added the Overdue label Nov 15, 2024
@MitchExpensify MitchExpensify added the External Added to denote the issue can be worked on by a contributor label Nov 15, 2024
@melvin-bot melvin-bot bot changed the title User lands on concierge instead of the LHN [$250] User lands on concierge instead of the LHN Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

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

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

melvin-bot bot commented Nov 15, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Nov 15, 2024
@MitchExpensify
Copy link
Contributor

The expected bahevior is to land in LHN

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 15, 2024

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

navigateAfterOnboarding(isSmallScreenWidth, shouldUseNarrowLayout, canUseDefaultRooms, onboardingPolicyID, activeWorkspaceID, route.params?.backTo);

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

if (!lastAccessedReportID || lastAccessedReport.policyID === onboardingPolicyID) {
// Only navigate to concierge chat when central pane is visible
// Otherwise stay on the chats screen.
if (!shouldUseNarrowLayout && !backTo) {
Report.navigateToConciergeChat();
}
return;
}

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

Navigation.navigate(lastAccessedReportRoute);

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;
}

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

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

if (!isSmallScreenWidth) {

And if isSmallScreenWidth is true, shouldUseNarrowLayout is always true and this condition is always false so we can remove this block.

if (!shouldUseNarrowLayout && !backTo) {
Report.navigateToConciergeChat();
}

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
Copy link
Contributor

mkzie2 commented Nov 15, 2024

I created a proposal in this issue #52018 and bring it here since it's the same issue.

@danielrvidal
Copy link
Contributor

@mollfpr any thoughts on which proposal to go with?

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
@mollfpr
Copy link
Contributor

mollfpr commented Nov 19, 2024

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:

@melvin-bot melvin-bot bot removed the Overdue label Nov 19, 2024
@MitchExpensify
Copy link
Contributor

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

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 21, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Nov 21, 2024
@mollfpr
Copy link
Contributor

mollfpr commented Nov 21, 2024

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?

@melvin-bot melvin-bot bot removed the Overdue label Nov 21, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Nov 21, 2024

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

@Nodebrute
Copy link
Contributor

The expected bahevior is to land in LHN

@mollfpr The expected result is that the user should land on the LHN. The previous issue (#52018) was closed because the expected result provided at the time was incorrect.

Copy link

melvin-bot bot commented Nov 22, 2024

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

@danielrvidal
Copy link
Contributor

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.

@melvin-bot melvin-bot bot added the Overdue label Nov 24, 2024
@Shahidullah-Muffakir
Copy link
Contributor

Shahidullah-Muffakir commented Nov 24, 2024

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:

Navigation.navigate(lastAccessedReportRoute);

we are navigating to the last accessed report.

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

based on:
#52420 (comment) and #52420 (comment)

it seems, here:

Navigation.navigate(lastAccessedReportRoute);

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

What alternative solutions did you explore? (Optional)

I think we can totally replace these two lines:

navigateAfterOnboarding(isSmallScreenWidth, shouldUseNarrowLayout, canUseDefaultRooms, onboardingPolicyID, activeWorkspaceID, route.params?.backTo);

and
navigateAfterOnboarding(isSmallScreenWidth, shouldUseNarrowLayout, canUseDefaultRooms, onboardingPolicyID, activeWorkspaceID, route.params?.backTo);

with

   Navigation.dismissModal();
    Navigation.navigate(ROUTES.HOME);

@MitchExpensify
Copy link
Contributor

What do you think about the latest proposal @mollfpr ?

Copy link

melvin-bot bot commented Nov 26, 2024

@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
Copy link
Contributor

mkzie2 commented Nov 26, 2024

Updated proposal.

Copy link

melvin-bot bot commented Nov 26, 2024

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

@mollfpr
Copy link
Contributor

mollfpr commented Nov 26, 2024

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 melvin-bot bot removed the Overdue label Nov 26, 2024
Copy link

melvin-bot bot commented Nov 26, 2024

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

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

melvin-bot bot commented Nov 26, 2024

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

@MitchExpensify
Copy link
Contributor

@mkzie2 what is your Upwork profile?

@mkzie2
Copy link
Contributor

mkzie2 commented Nov 27, 2024

@MitchExpensify
Copy link
Contributor

Thanks, offer sent @mkzie2 !

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 28, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Nov 28, 2024

@mollfpr The PR is ready.

@MariaHCD
Copy link
Contributor

@mkzie2 we had to revert your PR since it was causing typecheck and ESLint errors:

#54194
#54193

Please review the errors and resubmit a new PR. Thanks!

@mkzie2
Copy link
Contributor

mkzie2 commented Dec 16, 2024

@MariaHCD I created a fix here for the error.

@mollfpr
Copy link
Contributor

mollfpr commented Dec 16, 2024

@MariaHCD @mkzie2 I think we still have time with the fix.

@mkzie2 mkzie2 mentioned this issue Dec 16, 2024
50 tasks
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 16, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Dec 16, 2024

@mollfpr The PR is ready.

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants