Skip to content

Expense-Unable to switch off "reimbursable" toggle when creating expense #105205

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.24-2
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #103211
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Desktop / Windows 11
App Component: Chat Report View

Action Performed:

  1. Open the Expensify Web App and log in
  2. Create a workspace
  3. Click on the "+" button and click on "Create expense"
  4. Switch to manual and scroll down
  5. Try to switch off the "reimbursable" toggle

Expected Result:

The user should be able to switch off the reimbursable toggle when creating an expense.

Actual Result:

The user cannot switch off the reimbursable toggle when creating an expense.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7298386_1793142190546.Expensify_PR103211_Reimbursable.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7298386

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 27, 2026
  2. applause-bot commented on Oct 27, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/570bead1c4af3ae35a079f7bdbbb18a602caa45a2cfae61d34bbac8566962d90

  3. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #103211

  4. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    @Beamanator you have been assigned to this deploy blocker because you reviewed the offending PR: #103211

  5. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    @c3024 you have been assigned to this deploy blocker because you authored the offending PR: #103211

  6. melvin-bot commented on Oct 27, 2026

    @melvin-bot

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

  7. github-actions commented on Oct 27, 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.
  8. MelvinBot commented on Oct 27, 2026

    @MelvinBot
    Contributor

    Deploy Blocker Investigation

    Causing PR: [No QA] Disallow manual memoization in compiled React code (Expensify/App#104522), not the auto-assigned [CP Staging] Revert "Add Vendor filter to expense Search". High confidence.

    Root cause: The PR replaced a useMemo keyed only on transactions.length with a plain transactions.map(...) in IOURequestStepConfirmation/index.tsx:175. Now every draft edit creates a new transactionIDs array. That re-runs the effects in ExpenseDefaultsSetter.tsx:26-43, which reset reimbursable and billable to the policy defaults. Turning Reimbursable off writes false, then the effect immediately writes true back.

    Recommendation: roll forward with a small fix. Reverting a 932-file PR in a cherry-pick will likely conflict. Keep revert as the fallback.

    Make transactionIDs change only when the set of IDs changes:

    // Key on the IDs alone so editing a draft's details doesn't re-run the defaults setters and overwrite what the user picked.
    const transactionIDsKey = transactions.map((item) => item.transactionID).join(',');
    const transactionIDs = transactionIDsKey ? transactionIDsKey.split(',') : [];

    Retest after the fix:

    • Billable toggle (same bug).
    • Editing merchant, amount, or description no longer resets reimbursable or billable.
    • Clearing the default category on a distance expense (CategoryDefaultsSetter.tsx:61-70 also depends on transactionIDs).

    Assignees: roryabraham (author) and chrispader / mountiny (approvers) own this. c3024 and Beamanator were auto-assigned in error and can be unassigned.

    Investigation details
    • [No QA] Disallow manual memoization in compiled React code #104522 merged 2026-10-26 (merge commit 5cb8254). It's in v9.5.24-2 on staging but not production, which matches the repro.
    • The removed code was intentional. Its comment read: "Depend on transactions.length to avoid updating transactionIDs when only the transaction details change", followed by an eslint-disable for react-hooks/exhaustive-deps. React Compiler memoizes on the whole transactions array, so that narrowing was lost.
    • transactions comes from the full draft objects, so any field change produces a new array.
    • [CP Staging] Revert "Add Vendor filter to expense Search" #103211 only removes the Vendor search filter and never touches reimbursable logic. melvin-bot likely picked it because the tester put that PR link in the BrowserStack field.

    Code review rule suggestion (for human review): Add a rule to app-coding-standards that flags removing a useMemo/useCallback whose deps were deliberately narrowed (preceded by eslint-disable-next-line react-hooks/exhaustive-deps, or deps like x.length). Ask the author to keep the narrowed identity with a primitive key instead, such as a joined ID string. #104522 makes manual memoization a lint error, so more of these removals are likely.


    view run

  9. m-natarajan commented on Oct 28, 2026

    @m-natarajan

    This issue is not repro on windows10/chrome and iphone 11/26.2 (Pending validation in Android) build 9.5.24-5

    ScreenRecording_10-28-2026.17-13-15_1.MP4
    Recording.1936.mp4
  10. melvin-bot commented on Oct 29, 2026

    @melvin-bot

    @roryabraham @c3024

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

    The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ 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]. If no checklist is needed for this issue, you can click: [no checklist button]

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions