App: [HOLD for payment 2023-12-07] [$500] Go back from `Flag as offensive` doesn't display correct report page

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: 1.3.87-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: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @suneox Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697654423349679

Action Performed:

  1. Go to any public room report exam
  2. Hold touch on any chat message select “Flag as offensive”
  3. Reload page exam
  4. Select back button

Expected Result:

App should display report from Flag as offensive

Actual Result:

App doesn’t display report from Flag as offensive

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

Android: Native
Android: mWeb Chrome

https://github.com/Expensify/App/assets/38435837/8a47ab34-5c7c-4447-8abc-b098b5150329

iOS: Native
iOS: mWeb Safari

https://github.com/Expensify/App/assets/38435837/eaa58a6e-b5eb-4774-b9ad-f7db12689630

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/38435837/ea864e94-58a3-49e8-b380-93b9214bf574

MacOS: Desktop

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01bff2f94a7065c212
  • Upwork Job ID: 1715445279961526272
  • Last Price Increase: 2023-10-20
  • Automatic offers:
    • suneox | Contributor | 27349484

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 51 (23 by maintainers)

Most upvoted comments

Thank @Christinadobrzyn and @mananjadhav I have received payment

@Christinadobrzyn once it is paid out and the regression test is added we can close it.

No regression here @Christinadobrzyn

Base on PR I think no regression

Yeah I think it’s best we add a regression test. We’ve updated the back button logic and also added some calls to Navigation. QA steps from the PR body looks fine to me.

There is no offending PR, because I think we didn’t consider this case.

@iwiznia I would recommend we do nothing on this one.

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

Proposal

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

Go back from Flag as offensive doesn’t display correct report page

What is the root cause of that problem?

In the HeaderWithBackButton of the FlagCommentPage we dont specify a route for the back action

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

We should handle onBackButtonPress go to current report from HeaderWithBackButton

   <HeaderWithBackButton
      title={props.translate(‘reportActionContextMenu.flagAsOffensive’)}
      onBackButtonPress={() => {
          const topMostReportID = Navigation.getTopmostReportId();
          if (topMostReportID) {
              Navigation.goBack(ROUTES.HOME);
              return;
          }
          Navigation.goBack();
          Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(props.report.reportID));
      }}
   />

this pattern has been applied at ReportDetailPage to avoid back multiple times keep navigation history

What alternative solutions did you explore? (Optional)

If we need to keep the navigation history just update it to

    <HeaderWithBackButton
        title={props.translate(‘reportActionContextMenu.flagAsOffensive’)}
        onBackButtonPress={() => Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(props.report.reportID))}
    />

@suneox Can you please post a comment with your proposal? So that it can be assigned.