Skip to content

[$250] Expense - The details of an expense don't work after going back when writing a merchant #76898

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.73-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-2306/folder/13177075/41703290/1060194310
Email or phone of affected tester (no customers): joelarmandotester+610@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the Hybrid App
  2. Create a new account
  3. Start a chat 1:1 with other user
  4. Create a new expense with amount only
  5. Open the expense details and tap on the "Merchant" field
  6. Type any merchant and swipe right to go back
  7. Tap on other field

Expected Result:

The other areas of expense should function correctly

Actual Result:

After swiping right to go back, the expense fields don't work

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

+++

Bug7021973_1764965279061.Merchant_Issue.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
Issue Owner

Current Issue Owner: @JmillsExpensify

Activity

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

    @melvin-bot

    Triggered auto assignment to @JmillsExpensify (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. Nodebrute commented on Dec 6, 2025

    @Nodebrute
    Contributor

    Proposal

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

    The details of an expense don't work after going back when writing a merchant

    What is the root cause of that problem?

    On ios native, when a user tries to go back from a MoneyRequest screen with unsaved changes the native back gesture/button removes the screen from the native stack. The JavaScript code tries to prevent navigation using beforeRemove (which calls e.preventDefault()). beforeRemove doesn’t fully prevent native navigation, so the screen is removed natively but stays in JavaScript state. This mismatch causes the error: The screen 'MoneyRequest' was removed natively but didn't get removed from JS state. Consider using a 'usePreventRemove' hook with 'headerBackButtonMenuEnabled: false' to prevent users from natively going back multiple screens.

    useBeforeRemove(
    useCallback(
    (e) => {
    if (!getHasUnsavedChanges()) {
    return;
    }
    e.preventDefault();
    blockedNavigationAction.current = e.data.action;
    setIsVisible(true);
    },
    [getHasUnsavedChanges],
    ),
    );

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

    As the other itself suggest we should use usePreventRemove hook. We can use usePreventRemove here instead of useBeforeRemove

    useBeforeRemove(
    useCallback(
    (e) => {
    if (!getHasUnsavedChanges()) {
    return;
    }
    e.preventDefault();
    blockedNavigationAction.current = e.data.action;
    setIsVisible(true);
    },
    [getHasUnsavedChanges],
    ),
    );

    We can do something like

    
        usePreventRemove(shouldPreventRemove, useCallback(() => {
            setIsVisible(true);
        }, []));
    

    and in here we can do

       onConfirm={() => {
                    setIsVisible(false);
                    navigationRef.current?.goBack();
                }}
    

    Results

    Screen.Recording.2025-12-07.at.4.30.46.AM.mov

    Optional(not critical or important)
    We can add headerBackButtonMenuEnabled: false, as the error suggests to the description and merchant screen. We can do something like this

    [SCREENS.MONEY_REQUEST.STEP_MERCHANT]: {
            native: {
                headerBackButtonMenuEnabled: false,
            },
        },
        [SCREENS.MONEY_REQUEST.STEP_DESCRIPTION]: {
            native: {
                headerBackButtonMenuEnabled: false,
            },
        },
    

    What alternative solutions did you explore? (Optional)

  4. JmillsExpensify commented on Dec 9, 2025

    @JmillsExpensify
    Contributor

    Odd. I'll open up for proposals

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Dec 9, 2025
  6. changed the title [-]Expense - The details of an expense don't work after going back when writing a merchant[/-] [+][$250] Expense - The details of an expense don't work after going back when writing a merchant[/+] on Dec 9, 2025
  7. melvin-bot commented on Dec 9, 2025

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

    @melvin-bot

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

  10. ZhenjaHorbach commented on Dec 11, 2025

    @ZhenjaHorbach
    Contributor

    This proposal makes sense to me!

    🎀👀🎀 С+

  11. 75 remaining items

  12. ZhenjaHorbach commented on Mar 24, 2026

    @ZhenjaHorbach
    Contributor

    @JmillsExpensify
    I suppose it's ready for payment
    Since the follow up issue will be closed soon and we are done here!

  13. JmillsExpensify commented on Mar 24, 2026

    @JmillsExpensify
    Contributor

    Payment summary:

  14. mallenexpensify commented on Mar 24, 2026

    @mallenexpensify
    Contributor

    @ZhenjaHorbach was there a regression here?

    If so, pay should be reduced. If not, please provide reasoning. Thx

  15. ZhenjaHorbach commented on Mar 24, 2026

    @ZhenjaHorbach
    Contributor

    @ZhenjaHorbach was there a regression here?

    If so, pay should be reduced. If not, please provide reasoning. Thx

    We agreed that this is a follow-up issue
    #78590 (comment)
    Since we fixed the main critical issue, but we needed to add a few additional improvements
    So I think we don't need to change a payment

  16. garrettmknight commented on Mar 25, 2026

    @garrettmknight
    Contributor

    $250 approved for @ZhenjaHorbach

  17. melvin-bot commented on Mar 27, 2026

    @melvin-bot

    @tylerkaraszewski, @JmillsExpensify, @ZhenjaHorbach, @Nodebrute Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. melvin-bot commented on Mar 27, 2026

    @melvin-bot

    @tylerkaraszewski, @JmillsExpensify, @ZhenjaHorbach, @Nodebrute Whoops! This issue is 2 days overdue. Let's get this updated quick!

  19. melvin-bot commented on Mar 31, 2026

    @melvin-bot

    @tylerkaraszewski, @JmillsExpensify, @ZhenjaHorbach, @Nodebrute 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  20. melvin-bot commented on Mar 31, 2026

    @melvin-bot

    @tylerkaraszewski, @JmillsExpensify, @ZhenjaHorbach, @Nodebrute Still overdue 6 days?! Let's take care of this!

  21. melvin-bot commented on Apr 2, 2026

    @melvin-bot

    @tylerkaraszewski, @JmillsExpensify, @ZhenjaHorbach, @Nodebrute 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  22. JmillsExpensify commented on Apr 5, 2026

    @JmillsExpensify
    Contributor

    I think we're done here now, though let me know if I missed something.

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