Skip to content

[Due for payment 2025-11-19] [$250] Entered distance doesn't disappear from Track Distance page when switching tabs #74321

Closed

Description

@izarutskaya

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.44-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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: @linhvovan29546
Slack conversation (hyperlinked to channel name): #expensify_bugs

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Click FAB > Track Distance > Manual (If not selected)
  3. Enter an distance
  4. Switch to the Map tab
  5. Switch back to the Manual tab

Expected Result:

The distance should disappear after switching between tabs

Actual Result:

The distance remain after switching between tabs

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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

Recording.3491.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021986150953309942505
  • Upwork Job ID: 1986150953309942505
  • Last Price Increase: 2025-11-05
  • Automatic offers:
    • truph01 | Reviewer | 109389997
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify

Activity

  1. added
    Daily
    Bug
    on Nov 5, 2025
  2. melvin-bot commented on Nov 5, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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. nyomanjyotisa commented on Nov 5, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Entered distance doesn't disappear from Track Distance page when switching tabs

    What is the root cause of that problem?

    When the user switches between tabs, the useEffect that listens for tab changes only clears the form error but doesn't clear the entered distance value from the form

    useEffect(() => {
    if (isLoadingSelectedTab) {
    return;
    }
    setFormError('');
    }, [selectedTab, isLoadingSelectedTab]);

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

    Update the useEffect to also clear the distance input when switching tabs:

        useEffect(() => {
            if (isLoadingSelectedTab) {
                return;
            }
            setFormError('');
            numberFormRef.current?.updateNumber('');
        }, [selectedTab, isLoadingSelectedTab]);

    What alternative solutions did you explore? (Optional)

    None

  4. Eskalifer1 commented on Nov 5, 2025

    @Eskalifer1
    Contributor

    Proposal

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

    Entered distance doesn't disappear from Track Distance page when switching tabs

    What is the root cause of that problem?

    Currently we dont reset value on tab change, so value remains

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

    We already have useEffect for initialization here:

    useEffect(() => {
    if (numberFormRef.current && numberFormRef.current?.getNumber() === distance?.toString()) {
    return;
    }
    numberFormRef.current?.updateNumber(distance?.toString() ?? '');
    }, [distance]);

    We can include selectedTab into deps, so every time tabs change we will check the value and resetting

    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.

  5. joekaufmanexpensify commented on Nov 5, 2025

    @joekaufmanexpensify
    Contributor

    @nyomanjyotisa @truph01 @Julesssss shouldn't this have been handled in #73475? It seems like the exact issue, just on a different menu

  6. Julesssss commented on Nov 5, 2025

    @Julesssss
    Contributor

    Good spot. We didn't specifically call out that we would fix this other flow in the proposal.

    @nyomanjyotisa @truph01 would you like to work on this second instance for a 50% of the typical bounty? Given that we already have the solution

  7. truph01 commented on Nov 5, 2025

    @truph01
    Contributor

    @Julesssss I'd like to work on this issue as C+

  8. Eskalifer1 commented on Nov 5, 2025

    @Eskalifer1
    Contributor

    I believe here is different RCA @Julesssss

  9. Julesssss commented on Nov 5, 2025

    @Julesssss
    Contributor

    @nyomanjyotisa's proposal works for me

  10. added
    External
    on Nov 5, 2025
  11. 27 remaining items

  12. added
    Daily
    and removed
    Weekly
    on Nov 18, 2025
  13. joekaufmanexpensify commented on Nov 19, 2025

    @joekaufmanexpensify
    Contributor
  14. joekaufmanexpensify commented on Nov 19, 2025

    @joekaufmanexpensify
    Contributor

    @Eskalifer1 offer sent!

  15. joekaufmanexpensify commented on Nov 19, 2025

    @joekaufmanexpensify
    Contributor

    We'll pay this out as soon as the checklist is completed

  16. truph01 commented on Nov 19, 2025

    @truph01
    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:

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

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

    • [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. Click FAB > Track Distance
    2. Enter an distance
    3. Switch to the Map tab
    4. Switch back to the Manual tab
    5. Make sure the distance is disappeared after switching between tabs

    Do we agree 👍 or 👎

  17. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor
  18. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    All set to pay!

  19. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    Payment Summary

  20. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    @Eskalifer1 $250 sent and contract ended!

  21. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    @truph01 $250 sent and contract ended!

  22. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    Upwork job closed

  23. joekaufmanexpensify commented on Nov 20, 2025

    @joekaufmanexpensify
    Contributor

    All set, thanks everyone 👍

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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions