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

Android- Faulty back button- first shows hmm, it's not here page, then goes forward to concierge, then goes blank #24053

Closed
1 of 6 tasks
kavimuru opened this issue Aug 2, 2023 · 17 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Internal Requires API changes or must be handled by Expensify staff

Comments

@kavimuru
Copy link

kavimuru commented Aug 2, 2023

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


Action Performed:

1 Create a new workspace
2 Go to the admin page of the workspace
3 Send a message
4 Click on reply on thread. This will open the thread
5 Open the detail page (the icon on top)
6 Click on Leave thread. Verify concierge is opened.
7 Click on the back button: Verify you get “hmm, it’s not here page‘
8 Click on the back button again: Verify again Concierge is opened (which was NOT the last visited page. It basically takes you forward)
9 Click on the back button again: Verify nothing appears on screen

Expected Result:

Back button would work properly

Actual Result:

Back button not working properly. Concierge is opened twice and once nothing is displayed on the screen while another time it shows 'hmm, its not here' page

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 / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.49-0
Reproducible in staging?: y
Reproducible in production?: y
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

Record_2023-07-30-18-47-56.mp4
az_recorder_20230802_072027.1.mp4

Expensify/Expensify Issue URL:
Issue reported by: @avi-shek-jha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690762297106729

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e8f01ced5d4edfe6
  • Upwork Job ID: 1696831825348169728
  • Last Price Increase: 2023-08-30
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 2, 2023
@dukenv0307
Copy link
Contributor

Proposal

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

Android- Faulty back button- first shows hmm, it's not here page, then goes forward to concierge, then goes blank

What is the root cause of that problem?

We goBack to the sidebar screen with shouldPopToTop as true to clear all previous pages in the stack navigator

onNavigationMenuButtonClicked={() => Navigation.goBack(ROUTES.HOME, false, true)}

In goBack function, we only do this action if both shouldPopToTop and shouldPopAllStateOnUP are true
if (shouldPopToTop) {
if (shouldPopAllStateOnUP) {
shouldPopAllStateOnUP = false;
navigationRef.current.dispatch(StackActions.popToTop());
return;

But shouldPopAllStateOnUP is only true when we don't start on the small screen the screen size is changed
useEffect(() => {
if (firstRenderRef.current) {
// we don't want to make the report back button go back to LHN if the user
// started on the small screen so we don't set it on the first render
// making it only work on consecutive changes of the screen size
firstRenderRef.current = false;
return;
}
if (!isSmallScreenWidth) {
return;
}
Navigation.setShouldPopAllStateOnUP();

That makes back button in Header doesn't work properly

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

We should update the condition here to clear all previous pages in the stack navigator if shouldPopToTop is true

if (shouldPopToTop || shouldPopAllStateOnUP) {
    if (shouldPopAllStateOnUP) {
        shouldPopAllStateOnUP = false;
    }
    navigationRef.current.dispatch(StackActions.popToTop());
    return;
}

if (shouldPopToTop) {
if (shouldPopAllStateOnUP) {
shouldPopAllStateOnUP = false;
navigationRef.current.dispatch(StackActions.popToTop());
return;

What alternative solutions did you explore? (Optional)

Before we call goBack here we can call Navigation.setShouldPopAllStateOnUP(); to set shouldPopAllStateOnUP as true

onNavigationMenuButtonClicked={() => Navigation.goBack(ROUTES.HOME, false, true)}

Result

abc.mp4

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 2, 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

@himanshuragi456
Copy link
Contributor

Proposal

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

Android- Faulty back button- first shows hmm, it's not here page, then goes forward to concierge, then goes blank

What is the root cause of that problem?

To understand this, we need to understand how events are flowing after we hit "Leave Thread"

  • Report.leaveRoom(props.report.reportID) is triggered.
  • if we check inside leaveRoom, navigateToConciergeChat is being called after the API call. in API call, optimisticData instantly removes the Thread from the user's access and displays "hmm, it's not here" page.
  • next, we get directed to "concierge" chat, which is fine and expected behaviour
  • now if we click back button navigation, we get directed to the thread chat pages, to which we don't have access and hence the error page.

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

  • to fix first issue here, we should move navigateToConciergeChat to the top line of leaveRoom function. so that, the user get directed to "concierge" chat and then only the API call starts and removes thread's access.
  • to fix the second issue, we need to clear the navigation stack so that the user gets directed to home screen when hitting the back arrow button.

What alternative solutions did you explore? (Optional)

N/A

@HezekielT
Copy link
Contributor

This is dupe of #20908

@melvin-bot melvin-bot bot added the Overdue label Aug 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

@mallenexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 21, 2023

This issue has not been updated in over 14 days. @mallenexpensify eroding to Weekly issue.

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 23, 2023

@mallenexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Aug 28, 2023

@mallenexpensify Eep! 4 days overdue now. Issues have feelings too...

@mallenexpensify
Copy link
Contributor

@kavimuru , can you see if you're able to reproduce? Per @HezekielT 's comment above, I'm wanting to see if #24165 fixes this issue. Thanks

@melvin-bot melvin-bot bot removed the Overdue label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

@mallenexpensify this issue is now 4 weeks old and preventing us from maintaining WAQ. This should now be your highest priority. Please post below what your plan is to get a PR in review ASAP. Thanks!

@melvin-bot melvin-bot bot added the Internal Requires API changes or must be handled by Expensify staff label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

Triggered auto assignment to Contributor Plus for review of internal employee PR - @cubuspl42 (Internal)

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

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

@cubuspl42
Copy link
Contributor

I believe the last action point was the request to @kavimuru from @mallenexpensify to re-test. I prioritized other issues, as this one seemed not confirmed to be reproducible.

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@mallenexpensify
Copy link
Contributor

For the reproducible steps in the OP, I get this
6 Click on Leave thread. Verify concierge is opened.

  • Yes.

7 Click on the back button: Verify you get “hmm, it’s not here page‘
image

8 Click on the back button again: Verify again Concierge is opened (which was NOT the last visited page. It basically takes you forward)
image
9 Click on the back button again: Verify nothing appears on screen
image

so, I don't think the specific bug is reproducible and that it was fixed by
#24165

This bug was reported after one's linked in the above PR so the bug reporting bounty is not applicable. Thx

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 Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

6 participants