Skip to content

[Due for payment 2025-05-14] [$250] Expense Reports-After closing receipt view, app opens Inbox (web), iOS app reopens same report #60101

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

Closed
6 of 8 tasks
mitarachim opened this issue Apr 11, 2025 · 33 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

Comments

@mitarachim
Copy link

mitarachim commented Apr 11, 2025

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


Version Number: 9.1.27-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: #59735
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense with receipt.
  4. Go to Reports > Expense Reports.
  5. Click on the expense report from Step 3.
  6. Click on the receipt.
  7. On web, click X button to close the receipt view.
  8. On mweb, Android/iOS, tap app back button, then tap app back button again.

Expected Result:

On web (Step 7), app will remain on Reports page after closing receipt view.
On mweb, Android/iOS, after closing receipt view and tapping app back button, app will return to Expense Reports.

Actual Result:

On web (Step 7), app opens Inbox after closing receipt view.
On mweb, Android/iOS, after closing receipt view and tapping app back button, app reopens the same report.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6799227_1744358320737.iOS.mp4
Bug6799227_1744358320756.web_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021911809936832796582
  • Upwork Job ID: 1911809936832796582
  • Last Price Increase: 2025-04-14
Issue OwnerCurrent Issue Owner: @sakluger / @joekaufmanexpensify
@mitarachim mitarachim added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Apr 11, 2025
Copy link

melvin-bot bot commented Apr 11, 2025

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

@daledah
Copy link
Contributor

daledah commented Apr 11, 2025

Proposal

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

On web (Step 7), app opens Inbox after closing receipt view.
On mweb, Android/iOS, after closing receipt view and tapping app back button, app reopens the same report.

What is the root cause of that problem?

We don't handle case that we open the receipt in Expense Report in Search page

// Receipt Page can be opened either from Reports or from Search RHP view
// We have to handle going back to correct screens, if it was opened from RHP just close the modal, otherwise go to Report Page
const rootState = navigationRef.getRootState() as State<RootNavigatorParamList>;
const secondToLastRoute = rootState.routes.at(-2);
if (secondToLastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || isDraftTransaction) {
Navigation.dismissModal();
} else {

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

WE should add the case we open the receipt in Expense Report in Search page by updating the condition here

       if (secondToLastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || secondToLastRoute?.name === NAVIGATORS.SEARCH_FULLSCREEN_NAVIGATOR || isDraftTransaction) {
            Navigation.dismissModal();
        } 

if (secondToLastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || isDraftTransaction) {
Navigation.dismissModal();
} else {

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

None

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@bernhardoj
Copy link
Contributor

Proposal

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

Closing the receipt preview from search page leads the user to the report screen.

What is the root cause of that problem?

When the modal close, we use dismiss modal with a reportID that will open the report page.

const onModalClose = () => {
// Receipt Page can be opened either from Reports or from Search RHP view
// We have to handle going back to correct screens, if it was opened from RHP just close the modal, otherwise go to Report Page
const rootState = navigationRef.getRootState() as State<RootNavigatorParamList>;
const secondToLastRoute = rootState.routes.at(-2);
if (secondToLastRoute?.name === NAVIGATORS.RIGHT_MODAL_NAVIGATOR || isDraftTransaction) {
Navigation.dismissModal();
} else {
const isOneTransactionThread = isOneTransactionThreadReportUtils(report?.reportID, report?.parentReportID, parentReportAction);
const dismissModalReportID = isOneTransactionThread ? report?.parentReportID : report?.reportID;
if (!dismissModalReportID) {
Navigation.dismissModal();
return;
}
Navigation.dismissModalWithReport({reportID: dismissModalReportID});
}
};

When it was implemented, we use goBack with fallback route to the report details (it should be report). But now, we have a complex condition to decide whether to use dismiss modal with or without report.

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

I suggest to simplify it by just using dismissModal for all cases.
onModalClose={Navigation.dismissModal}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@melvin-bot melvin-bot bot added the Overdue label Apr 14, 2025
Copy link

melvin-bot bot commented Apr 14, 2025

@sakluger Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Apr 14, 2025
@melvin-bot melvin-bot bot changed the title Expense Reports-After closing receipt view, app opens Inbox (web), iOS app reopens same report [$250] Expense Reports-After closing receipt view, app opens Inbox (web), iOS app reopens same report Apr 14, 2025
Copy link

melvin-bot bot commented Apr 14, 2025

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Apr 14, 2025
Copy link

melvin-bot bot commented Apr 14, 2025

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

@melvin-bot melvin-bot bot removed the Overdue label Apr 14, 2025
@sakluger sakluger moved this to Bugs and Follow Up Issues in #expensify-bugs Apr 14, 2025
Copy link

melvin-bot bot commented Apr 18, 2025

@rushatgabhane Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Apr 18, 2025
@rushatgabhane
Copy link
Member

When #35497, we use goBack with fallback route to the report details (it should be report). But now, we have a complex condition to decide whether to use dismiss modal with or without report

@bernhardoj i think the intention is to handle the case when you land on the link directly?

I suggest to simplify it by just using dismissModal for all cases. onModalClose={Navigation.dismissModal}

What do you thin of - goBack with fallback route to the report details?

@melvin-bot melvin-bot bot removed the Overdue label Apr 18, 2025
@bernhardoj
Copy link
Contributor

i think the intention is to handle the case when you land on the link directly?

I can't find a discussion about this on the issue that implemented it, but assuming we apply my proposal, and we access the receipt modal directly, the nav stack will be [Home, ReportScreen, TransactionReceiptPage].

So, the fallback isn't needed since the report screen is already added to the stack.

What do you thin of - goBack with fallback route to the report details?

Just to clarify, report detail is the incorrect fallback, it should be the report screen since user access the receipt from the report screen.

@rushatgabhane
Copy link
Member

ahhh thank you for helping me understand

@rushatgabhane
Copy link
Member

i like @bernhardoj 's proposal

🎀 👀 🎀

Copy link

melvin-bot bot commented Apr 19, 2025

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

@joekaufmanexpensify
Copy link
Contributor

Sounds good! PR merged and is awaiting deploy to staging

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels May 7, 2025
@melvin-bot melvin-bot bot changed the title [$250] Expense Reports-After closing receipt view, app opens Inbox (web), iOS app reopens same report [Due for payment 2025-05-14] [$250] Expense Reports-After closing receipt view, app opens Inbox (web), iOS app reopens same report May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label May 7, 2025
Copy link

melvin-bot bot commented May 7, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.40-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-05-14. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented May 7, 2025

@rushatgabhane @sakluger / @joekaufmanexpensify @rushatgabhane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@joekaufmanexpensify
Copy link
Contributor

@rushatgabhane could you handle checklist so we can prep to pay next week?

@joekaufmanexpensify
Copy link
Contributor

Bumped in slack

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels May 13, 2025
@joekaufmanexpensify
Copy link
Contributor

Pending checklist

Copy link

melvin-bot bot commented May 14, 2025

Payment Summary

Upwork Job

BugZero Checklist (@sakluger)

  • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1911809936832796582/hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@joekaufmanexpensify
Copy link
Contributor

Paying is pending on @rushatgabhane completing checklist

@joekaufmanexpensify
Copy link
Contributor

Bumped checklist.

@joekaufmanexpensify
Copy link
Contributor

@rushatgabhane bump on checklist when you have a sec!

@melvin-bot melvin-bot bot added the Overdue label May 19, 2025
@joekaufmanexpensify
Copy link
Contributor

Bumped in slack

@rushatgabhane
Copy link
Member

rushatgabhane commented May 19, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/35497/files#r2095824976

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion: N.A. not critical

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

  1. Open a workspace chat with no unsettled expenses
  2. Create a new money request
  3. Go to Reports and then switch to Expense Reports type
  4. Open the expense report from step 2
  5. Press on the receipt
  6. Close the receipt
  7. On Web/Desktop, verify that you stay at the search report screen
  8. On mWeb/Android/iOS, go back twice and verify that you stay at the search screen

Do we agree 👍 or 👎

@joekaufmanexpensify
Copy link
Contributor

TY! This is a pretty minor bug, so I think we can skip adding a new regression test for now. No need to have QA run this one every time.

@joekaufmanexpensify
Copy link
Contributor

All set to pay. We need to pay:

@joekaufmanexpensify
Copy link
Contributor

@bernhardoj @rushatgabhane Please request payment at your earliest convenience. Closing this as it's otherwise all set. TY!

@github-project-automation github-project-automation bot moved this from Second Cohort - CRITICAL to Done in [#whatsnext] #migrate May 19, 2025
@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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
Projects
Development

No branches or pull requests

8 participants