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

[HOLD for Payment 2024-08-22][$250] Search - Expense RHP closes after clicking on the From subtitle link #46518

Closed
6 tasks done
lanitochka17 opened this issue Jul 30, 2024 · 18 comments
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 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jul 30, 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.14-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to any chat
  3. Submit an expense
  4. Go to Search
  5. Click on the expense submitted in Step 3
  6. Click on the RHP header
  7. Click on the From subtitle link

Expected Result:

App will open the report from the subtitle link

Actual Result:

The expense RHP closes after clicking on the From subtitle link

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6557025_1722319302164.20240730_135933.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d7addf8985df968d
  • Upwork Job ID: 1818576628459044491
  • Last Price Increase: 2024-07-31
  • Automatic offers:
    • nkdengineer | Contributor | 103461487
Issue OwnerCurrent Issue Owner: @fedirjh
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 30, 2024
Copy link

melvin-bot bot commented Jul 30, 2024

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

@lanitochka17
Copy link
Author

@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@nkdengineer
Copy link
Contributor

Proposal

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

The expense RHP closes after clicking on the From subtitle link

What is the root cause of that problem?

When we open the report detail page from RHP Report Screen and click on the parent subtitle, we use goBack to navigate back to the report screen but it doesn't work as expected.

Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
if (isVisibleAction && !isOffline) {
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));

We only navigate back to the fallbackRoute if isFirstRouteInNavigator is true or we're in the central panel. In this case, the RHP stack has two screens RHP ReportScreen --> Report Detail Page so isFirstRouteInNavigator is false at both times we call goBack (we call goBack two times immediately so navigationRef.current.getState() is the same) and then we only go back to the previous screen two times Report Detail Page --> RHP ReportScreen --> Search Page.

const isFirstRouteInNavigator = !getActiveRouteIndex(navigationRef.current.getState());

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

We should pass shouldEnforceFallback param as true here to make sure we will use the fallbackRoute when we call goBack the second time.

Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));

What alternative solutions did you explore? (Optional)

We can use Navigation.isNavigationReady() to wait until the first goBack is complete before calling goBack the second time. With this at the second time the RHP stack has only RHP ReportScreen and then isFirstRouteInNavigator is true that leads we navigate to the fallbackRoute

// Pop the thread report screen before navigating to the chat report.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
if (isVisibleAction && !isOffline) {
    // Pop the chat report screen before navigating to the linked report action.
    Navigation.isNavigationReady().then(() => {
        Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
    });
}

Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
if (isVisibleAction && !isOffline) {
// Pop the chat report screen before navigating to the linked report action.
Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

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

@melvin-bot melvin-bot bot changed the title Search - Expense RHP closes after clicking on the From subtitle link [$250] Search - Expense RHP closes after clicking on the From subtitle link Jul 31, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
@jliexpensify
Copy link
Contributor

I'm able to repro this

Copy link

melvin-bot bot commented Jul 31, 2024

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

@fedirjh
Copy link
Contributor

fedirjh commented Aug 1, 2024

I am unable to replicate in the latest main

CleanShot.2024-08-01.at.12.08.30.mp4

@nkdengineer
Copy link
Contributor

nkdengineer commented Aug 1, 2024

@fedirjh I'm still able to reproduce this on the latest main bug by disabling the strict mode. Correct me if I missed something.

Screen.Recording.2024-08-01.at.20.24.02.mov

Copy link

melvin-bot bot commented Aug 6, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Aug 6, 2024
@fedirjh
Copy link
Contributor

fedirjh commented Aug 6, 2024

Thank you, @nkdengineer, for the suggestion. I managed to reproduce the issue on the dev by disabling strict mode. The proposed solution also seems satisfactory to me, so let's move forward with implementing the main solution.

Let's proceed with @nkdengineer's proposal;

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Aug 6, 2024

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

@nkdengineer
Copy link
Contributor

@NikkiWines Please help to take a look when you have a chance, thanks.

@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2024
@NikkiWines
Copy link
Contributor

Sorry for the delay, agreed that @nkdengineer's proposal looks good 👍

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

melvin-bot bot commented Aug 9, 2024

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 12, 2024
@NikkiWines NikkiWines changed the title [$250] Search - Expense RHP closes after clicking on the From subtitle link [HOLD for Payment 2024-08-22][$250] Search - Expense RHP closes after clicking on the From subtitle link Aug 19, 2024
@NikkiWines NikkiWines added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 19, 2024
@fedirjh
Copy link
Contributor

fedirjh commented Aug 23, 2024

BugZero Checklist:

  • Link to the PR: N/A, It seems this bug was hidden for a long time and has been discovered recently when a new feature was released.
  • Link to comment: N/A No PR.
  • Link to discussion: NA, With the strict mode enabled, it should be impossible to catch this bug in a dev environment.
  • Determine if we should create a regression test for this bug: Yes

Regression Test Proposal

Submit an expense
Go to Search
Click on the expense submitted in Step 3
Click on the RHP header
Click on the From subtitle link
Verify that: App will open the report from the subtitle link
  • Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Aug 25, 2024
@jliexpensify
Copy link
Contributor

Paying now, apologies for the delay!

Upwork job

@jliexpensify
Copy link
Contributor

Paid and job remvoed

@garrettmknight
Copy link
Contributor

$250 approved for @fedirjh

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 Reviewing Has a PR in review
Projects
Status: Done
Development

No branches or pull requests

6 participants