Skip to content

[Due for payment 2025-12-30] [$250] Reports - After created new expense, tapping back button returns to confirm detail page #76657

Closed

Description

@lanitochka17

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.2.71-1
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. Open app
  2. Navigate to any workspace chat create a manual expense
  3. Go to Reports tab
  4. At filter type expense, tap on this expense
  5. On composer box tap + button
  6. Select Create expense and complete create a manual expense
  7. Tap back button on the header

Expected Result:

Tapping back button on the header should return to Reports page

Actual Result:

Tapping back button on the header returns to confirm detail page

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug7019819_1764784514045.Cmjt8899_1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021998211233986731501
  • Upwork Job ID: 1998211233986731501
  • Last Price Increase: 2025-12-09
  • Automatic offers:
    • huult | Reviewer | 109826134
Issue OwnerCurrent Issue Owner: @strepanier03

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 3, 2025
  2. melvin-bot commented on Dec 3, 2025

    @melvin-bot

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

  3. SAYAN02-DEV commented on Dec 3, 2025

    @SAYAN02-DEV

    Proposal

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

    When a user navigates to the Reports tab, filters expenses (e.g., by type "expense"), taps on a filtered expense to open the workspace chat, creates a manual expense via the + button in the composer, and then taps the back button on the header after completing the expense creation, they are incorrectly returned to the confirmation/detail page instead of being returned to the Reports page where they started.

    What is the root cause of that problem?

    The root cause consists of two issues:

    1. Missing backToReport parameter in expense creation flow: When the user taps the + button in the workspace chat composer to create an expense, the startMoneyRequest function is called without passing a backToReport parameter that indicates the user came from the Reports page. This means the navigation system doesn't know where the user originated from.

    2. Incorrect navigation priority in navigateBack function: In IOURequestStepConfirmation.tsx, the navigateBack function checks for the backTo parameter first and immediately navigates to it. However, when creating an expense from a workspace chat that was accessed via the Reports page, we should prioritize the backToReport parameter instead, which specifically handles returning to the originating report/search view.

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

    Change 1: Update IOURequestStepConfirmation.tsx (lines ~392-393)

    Modify the navigateBack function to check for backToReport before backTo when creating a SUBMIT-type expense:

    const navigateBack = useCallback(() => {
        // If backToReport is provided and we're creating an expense from a workspace chat,
        // navigate back to that report instead of following the backTo parameter
        if (backToReport && iouType === CONST.IOU.TYPE.SUBMIT) {
            Navigation.goBack(backToReport);
            return;
        }
        
        if (backTo) {
            Navigation.goBack(backTo);
            return;
        }
        // ... rest of existing logic
    }, [
        // ... existing dependencies
        backToReport, // Add to dependency array
    ]);

    Change 2: Update AttachmentPickerWithMenuItems.tsx (lines ~195-226)

    Modify the moneyRequestOptions useMemo to detect if the user is coming from the Reports/Search page and pass that route as the backToReport parameter:

    const moneyRequestOptions = useMemo(() => {
        // Get the current route to determine if we're coming from Reports/Search page
        const currentRoute = Navigation.getActiveRoute();
        const isFromReportsPage = currentRoute?.startsWith('r/') || currentRoute?.includes('/search');
        const backToReport = isFromReportsPage ? currentRoute : undefined;
    
        const options: MoneyRequestOptions = {
            [CONST.IOU.TYPE.SUBMIT]: [
                {
                    icon: getIconForAction(CONST.IOU.TYPE.CREATE),
                    text: translate('iou.createExpense'),
                    shouldCallAfterModalHide: shouldUseNarrowLayout,
                    onSelected: () => selectOption(() => startMoneyRequest(CONST.IOU.TYPE.SUBMIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID), undefined, false, backToReport), true),
                },
                {
                    icon: Expensicons.Location,
                    text: translate('quickAction.recordDistance'),
                    shouldCallAfterModalHide: shouldUseNarrowLayout,
                    onSelected: () => selectOption(() => startDistanceRequest(CONST.IOU.TYPE.SUBMIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID), lastDistanceExpenseType, false, backToReport), true),
                },
            ],
            [CONST.IOU.TYPE.SPLIT]: [
                {
                    icon: Expensicons.Transfer,
                    text: translate('iou.splitExpense'),
                    shouldCallAfterModalHide: shouldUseNarrowLayout,
                    onSelected: () => selectOption(() => startMoneyRequest(CONST.IOU.TYPE.SPLIT, report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID), undefined, false, backToReport), true),
                },
            ],
            // ... rest of options
        };
        return // ... rest of useMemo
    }, [/* existing dependencies */]);

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

    What alternative solutions did you explore?

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 9, 2025
  5. changed the title [-]Reports - After created new expense, tapping back button returns to confirm detail page[/-] [+][$250] Reports - After created new expense, tapping back button returns to confirm detail page[/+] on Dec 9, 2025
  6. melvin-bot commented on Dec 9, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 9, 2025
  8. melvin-bot commented on Dec 9, 2025

    @melvin-bot

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

  9. strepanier03 commented on Dec 9, 2025

    @strepanier03
    Contributor

    Able to repro on Pixel 8 Android App, moving forward.

  10. SAYAN02-DEV commented on Dec 9, 2025

    @SAYAN02-DEV

    @strepanier03 will my proposal be reviewed?

  11. 24 remaining items

  12. mountiny commented on Dec 19, 2025

    @mountiny
    Contributor

    Merged

  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Dec 23, 2025
  14. changed the title [-][$250] Reports - After created new expense, tapping back button returns to confirm detail page[/-] [+][Due for payment 2025-12-30] [$250] Reports - After created new expense, tapping back button returns to confirm detail page[/+] on Dec 23, 2025
  15. melvin-bot commented on Dec 23, 2025

    @melvin-bot

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

  16. melvin-bot commented on Dec 23, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.85-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-12-30. 🎊

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

  17. melvin-bot commented on Dec 23, 2025

    @melvin-bot

    @huult @strepanier03 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]

  18. huult commented on Dec 29, 2025

    @huult
    Contributor

    BugZero Checklist:

    • [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/69875/changes#r2650233831

    • [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

    • [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

    Regression Test Proposal

    Precondition:

    Test:

    1. Open the Expensify app.
    2. Navigate to any workspace chat and create a manual expense.
    3. After creating the manual expense, go to the Reports tab.
    4. In the filter, choose Type: Expense, then tap the expense created in step 2.
    5. In the composer box, tap the + button.
    6. Select Create expense and complete creating another manual expense.
    7. After the expense is created, tap the Back button in the header.
    8. Verify that tapping the Back button in the header returns you to the Reports page.

    Do we agree 👍 or 👎

    Zapier Logs Run ID: 00040eee-1cd6-a52e-3299-17ffa758d614
  19. strepanier03 commented on Dec 30, 2025

    @strepanier03
    Contributor

    Payment Summary

    For: #77964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions