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

[$500] Android - Thread - Back button is not responsive in the parent report after leaving thread #28522

Closed
2 of 6 tasks
lanitochka17 opened this issue Sep 29, 2023 · 33 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 29, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Issue found when executing PR #27748

Action Performed:

  1. Launch New Expensify app
  2. Go to any chat with thread (leave the thread if you're already in one)
  3. Tap on the thread > Three-dot menu > Join thread
  4. Return to LHN
  5. Open the thread report from LHN
  6. Tap three-dot menu > Leave thread
  7. Tap on the back button
  8. Tap on the back button again

Expected Result:

Back button is responsive and user is able to return to LHN

Actual Result:

Back button is not responsive and user is stuck at at the parent report of the thread

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.75-3

Reproducible in staging?: Yes

Reproducible in production?: No

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6219498_1696016051473.Screen_Recording_20230930_015322_New_Expensify.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~018b26c9446b581810
  • Upwork Job ID: 1708820316584988672
  • Last Price Increase: 2023-10-09
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 29, 2023
@OSBotify
Copy link
Contributor

👋 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.

@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

Triggered auto assignment to @AndrewGable (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@dukenv0307
Copy link
Contributor

Proposal

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

Android - Thread - Back button is not responsive in the parent report after leaving thread

What is the root cause of that problem?

We have two bugs here:

  1. We go back to the parent report briefly before navigating to the concierge chat after leaving room

In leaveRoom function, we will go back to parent report if the room is the thread report

App/src/libs/actions/Report.js

Lines 1929 to 1931 in 52f0e3c

if (report.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
return;

But on ReportScreen, we have a useEffect that will go back to the concierge chat whenever we leaving the room

(prevOnyxReportID && prevOnyxReportID === routeReportID && !onyxReportID && prevReport.statusNum === CONST.REPORT.STATUS.OPEN && report.statusNum === CONST.REPORT.STATUS.CLOSED)
) {
Navigation.goBack();
Report.navigateToConciergeChat();
return;
}

  1. The back button is not responsive

Because we force-up here, the Home screen is replaced, and then cannot go back

App/src/libs/actions/Report.js

Lines 1929 to 1931 in 52f0e3c

if (report.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
return;

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

  1. If we always want to go back to concierge chat after leaving room, we can remove the navigate logic in leaveRoom function because we already have this in ReportScreen

App/src/libs/actions/Report.js

Lines 1925 to 1935 in 52f0e3c

Navigation.dismissModal();
if (Navigation.getTopmostReportId() === reportID) {
Navigation.goBack(ROUTES.HOME);
}
if (report.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
return;
}
navigateToConciergeChat();
}

  1. If not, we can remove the optimistic case here as we only want to do this if we leave room on another device
if (!prevUserLeavingStatus && userLeavingStatus) { 
    Navigation.goBack();
    Report.navigateToConciergeChat();
    return;
}

(prevOnyxReportID && prevOnyxReportID === routeReportID && !onyxReportID && prevReport.statusNum === CONST.REPORT.STATUS.OPEN && report.statusNum === CONST.REPORT.STATUS.CLOSED)
) {
Navigation.goBack();
Report.navigateToConciergeChat();
return;
}

And we need to move this block here to above here

App/src/libs/actions/Report.js

Lines 1929 to 1931 in 52f0e3c

if (report.parentReportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
return;

What alternative solutions did you explore? (Optional)

@mountiny
Copy link
Contributor

mountiny commented Oct 1, 2023

@dukenv0307 Thanks for the proposal, looks good to me but given this is a deploy blocker, can you highlight which PR caused this issue as that will be the real RCA.

@dukenv0307
Copy link
Contributor

@mountiny This coming from this PR #24407 that added the logic to go to concierge chat in ReportScreen

@wildan-m
Copy link
Contributor

wildan-m commented Oct 1, 2023

Hi, I think we can't go with option 2.

Removing an optimistic case will make another tab in the same browser session not navigated to the concierge, it will show "hmmm page not found"

@allroundexperts
Copy link
Contributor

@mountiny This was a very tricky PR because of so many edge cases. The PR itself is a regression fix PR. I think we should just revert #24407 and go to the drawing board again. Unless @wildan-m can fix this with a better solution.

@wildan-m
Copy link
Contributor

wildan-m commented Oct 1, 2023

Agree with @allroundexperts, please revert my PR, I'm on limited availability today

@mountiny
Copy link
Contributor

mountiny commented Oct 1, 2023

I like the revert approach as this is indeed tricky. @allroundexperts would you be able to make the revert pr for this?

@allroundexperts
Copy link
Contributor

@mountiny I will be in ~4 hours. I'm on my mobile currently.

@hoangzinh
Copy link
Contributor

I think #24407 is not a PR causing this deploy blocker. Because I tried to revert this PR in my local but it doesn't fix this deploy blocker.

Proof

Screen.Recording.2023-10-01.at.17.53.23.mov

IMO, It should be:

@wildan-m
Copy link
Contributor

wildan-m commented Oct 2, 2023

I'm the author of #24407, I don't see it as regression since the expected behavior change.

IMO the root cause is there is a redundant pop of navigation history, it uses goBack and also CONST.NAVIGATION.TYPE.FORCED_UP which will replace the navigation.

I'd recommend to make this change:

In LeaveRoom function, switch goBack position with goToParent

    Navigation.dismissModal();
    if (report.parentReportID) {
        Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
        return;
    }
    if (Navigation.getTopmostReportId() === reportID) {
        Navigation.goBack(ROUTES.HOME);
    }
    navigateToConciergeChat();

For ReportScreen add new condition to go to parent if it's a thread

        // Navigate to the Concierge chat if the room was removed from another device (e.g. user leaving a room)
        if (
            // non-optimistic case
            (!prevUserLeavingStatus && userLeavingStatus) ||
            // optimistic case
            (prevOnyxReportID && prevOnyxReportID === routeReportID && !onyxReportID && prevReport.statusNum === CONST.REPORT.STATUS.OPEN && report.statusNum === CONST.REPORT.STATUS.CLOSED)
        ) {
            if (report.parentReportID) {
                Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
                return;
            }

            Navigation.goBack();
            Report.navigateToConciergeChat();
            return;
        }

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Oct 2, 2023
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

@mountiny
Copy link
Contributor

mountiny commented Oct 2, 2023

Based on this conversation https://expensify.slack.com/archives/C01GTK53T8Q/p1696249324397149?thread_ts=1696016845.380819&cid=C01GTK53T8Q its reproducible in production but just a different steps as we moved the join/leave thread buttons around. The core issue is not a blocker though

Screen.Recording.2023-10-02.at.19.19.10.mov

@greg-schroeder
Copy link
Contributor

Not overdue Melv

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@wildan-m
Copy link
Contributor

wildan-m commented Oct 2, 2023

I can't reproduce it with the latest main.

Now, for expected behavior change, we'll just add this code

if (report.parentReportID) {
                Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.parentReportID), CONST.NAVIGATION.TYPE.FORCED_UP);
                return;
            }

to ReportScreen as suggested here.

again, I feel this is not a regression but a change to the requirement, holding this for more weeks seems not to be fair.

@allroundexperts what's your opinion?

@allroundexperts
Copy link
Contributor

again, I feel this is not a regression but a change to the requirement, holding this for more weeks seems not to be fair.

I would agree with with you here.

@melvin-bot melvin-bot bot added the Overdue label Oct 5, 2023
@greg-schroeder
Copy link
Contributor

I don't think the linked issue should be held as a regression personally. It would be if we hadn't adjusted the behavior, but we did, so... I tend to agree as well

@melvin-bot melvin-bot bot removed the Overdue label Oct 6, 2023
@greg-schroeder
Copy link
Contributor

@jjcoffee @allroundexperts @mountiny are we treating this as an open proposal review then and not a regression fix that @wildan-m should take on automatically? a bit confused where to go from here

@wildan-m
Copy link
Contributor

wildan-m commented Oct 6, 2023

@greg-schroeder, based on this and this. My PR is not directly related to this issue. The issue persisted even after my PR reverted.

@greg-schroeder
Copy link
Contributor

Yes I understand. Are you still making a proposal to resolve this issue anyway, or no?

@wildan-m
Copy link
Contributor

wildan-m commented Oct 6, 2023

@greg-schroeder, not yet, I'm working on another issue also resolve the requirement change caused by this PR #27127

Also, the last time I checked this issue was not reproducible with the latest main

@greg-schroeder
Copy link
Contributor

👍 okay I will try again to reproduce

@melvin-bot melvin-bot bot added the Overdue label Oct 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

@AndrewGable, @jjcoffee, @greg-schroeder Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot
Copy link

melvin-bot bot commented Oct 9, 2023

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

@greg-schroeder
Copy link
Contributor

Will get to this during the week. also @jjcoffee or @allroundexperts can either of you help confirm if it's reproducible or not with the different steps?

@melvin-bot melvin-bot bot removed the Overdue label Oct 10, 2023
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@melvin-bot
Copy link

melvin-bot bot commented Oct 13, 2023

@AndrewGable @jjcoffee @greg-schroeder 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!

@melvin-bot melvin-bot bot added the Overdue label Oct 13, 2023
@greg-schroeder
Copy link
Contributor

I cannot repro

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 13, 2023
@greg-schroeder
Copy link
Contributor

It seems maybe this was fixed elsewhere - nobody can repro. Going to close then.

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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests