Skip to content

[Due for payment 2026-01-28] [Payment due 2026-01-27] Distance - Unable to select category when distance default category is deleted #79814

Closed

Description

@nlemma

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.3.4-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #79652
Email or phone of affected tester (no customers): odnijosidjoisjdosjsdi@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.1 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Delete Car category (distance default category) in default workspace.
  1. Go to staging.new.expensify.com
  2. Go to self DM or workspace chat.
  3. Click + > Track distance > Manual.
  4. Enter amount > Next.
  5. On confirm page, click Category.
  6. Select any category.

Expected Result:

Selected category will show up on confirm page.

Actual Result:

Selected category does not show up on confirm page. Category cannot be selected.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7051466_1768608847507.1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 17, 2026
  2. melvin-bot commented on Jan 17, 2026

    @melvin-bot

    @Julesssss recently merged #79652, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on Jan 17, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jan 17, 2026

    @melvin-bot

    Triggered auto assignment to @mountiny (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jan 17, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. github-actions commented on Jan 17, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  7. OSBotify commented on Jan 17, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #79652 - "Distance expense category removed on 2nd policy switch" by @DylanDylann (High confidence)
    Related Issues: #79598 (original issue that PR #79652 was fixing)

    Recommendation: REVERT

    PR #79652 introduced a regression while attempting to fix a different bug. The PR added isFocused to the useEffect dependency array in IOURequestStepConfirmation.tsx, which causes the category to be reset when navigating back from the category selection page.

    Labels: Keeping DeployBlockerCash (App deploy is blocked)

    📋 Detailed Analysis

    Evidence

    PR #79652 was merged on 2026-01-16 and is included in staging version 9.3.4-0. The issue is reproducible on staging but NOT production, confirming this PR is the cause.

    The PR modified src/pages/iou/request/step/IOURequestStepConfirmation.tsx by:

    1. Adding useIsFocused hook
    2. Adding isFocused to the useEffect dependency array (line 418)

    Verification

    The affected file is src/pages/iou/request/step/IOURequestStepConfirmation.tsx, which PR #79652 directly modified.

    The bug report states:

    • Precondition: Delete "Car" category (the default category for distance expenses)
    • Steps: Track distance > Manual > Select category > Category does not appear
    • Only occurs when the default category is deleted

    Root Cause

    When "Car" is deleted, defaultCategory becomes an empty string. The problematic useEffect (lines 409-418) runs whenever the page becomes focused:

    useEffect(() => {
        for (const item of transactions) {
            if (!isDistanceRequest || !!item?.category) {
                continue;
            }
            setMoneyRequestCategory(item.transactionID, defaultCategory, policy);
        }
    }, [transactionIDs, requestType, defaultCategory, isFocused, policy?.id]);

    The bug flow:

    1. User selects a category (e.g., "Food") and navigates back
    2. Confirmation page becomes focused, triggering the useEffect
    3. Due to timing/race conditions, item?.category may not be set yet
    4. The useEffect calls setMoneyRequestCategory(item.transactionID, defaultCategory, policy)
    5. Since defaultCategory is empty (Car was deleted), this clears the user's selected category
    6. The category selection is lost

    The original PR #79652 was trying to fix a different bug (category removed on 2nd policy switch), but the addition of isFocused to the dependency array causes the useEffect to run at inappropriate times, specifically when returning from category selection.

  8. changed the title [-]Distance - Unable to select category when Car category is deleted[/-] [+]Distance - Unable to select category when distance default category is deleted[/+] on Jan 17, 2026
  9. 23 remaining items

  10. Julesssss commented on Jan 21, 2026

    @Julesssss
    Contributor

    Ah thanks! I saw a deploy blocker and raised the revert PR, didn't see this second one!

  11. changed the title [-][Payment due 2026-01-27] Distance - Unable to select category when distance default category is deleted[/-] [+][Due for payment 2026-01-28] [Payment due 2026-01-27] Distance - Unable to select category when distance default category is deleted[/+] on Jan 21, 2026
  12. melvin-bot commented on Jan 21, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.5-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 2026-01-28. 🎊

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

    • @Pujan92 requires payment through NewDot Manual Requests
  13. melvin-bot commented on Jan 21, 2026

    @melvin-bot

    @Pujan92 @kadiealexander 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]

  14. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  15. kadiealexander commented on Jan 27, 2026

    @kadiealexander
    Contributor

    ^ Deploy blocker above is not a regression

  16. kadiealexander commented on Jan 27, 2026

    @kadiealexander
    Contributor

    @Pujan92 please complete the checklist!

  17. Pujan92 commented on Jan 28, 2026

    @Pujan92
    Contributor

    I think we don't need a checklist here as it's DB and the original author has raised a fix for this.

    Regression Test Proposal

    Precondition:

    • Delete Car category (distance default category) in default workspace.
    1. Go to workspace chat
    2. Click + > Track distance > Manual
    3. Enter distance > Next
    4. On confirm page, click Category
    5. Select any category and verify that it has been shown correctly on the confirmation page
  18. kadiealexander commented on Jan 29, 2026

    @kadiealexander
    Contributor

    Payment Summary

    • Contributor+: @Pujan92 due $250 via NewDot
  19. twisterdotcom commented on Jan 29, 2026

    @twisterdotcom
    Contributor

    @Pujan92 has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-bbff-a01a-5fc9-405c40bdcda4
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.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions