Skip to content

Expense - Specific description entered using edit multiple is not saved #82797

Closed

Description

@jponikarchuk

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: V9.2.21-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #76264
Email or phone of affected tester (no customers): dreamnitethedragon@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Redminote 10S Android 13
App Component: User Settings

Action Performed:

  1. Launch app
  2. Create a new account
  3. Create 3 distance map expense with 1:1 user
  4. Go to reports
  5. Select and 2 expenses - edit multiple
  6. Enter description as <Shahrukh,khan>
  7. Tap save
  8. Open the expense
  9. Note description is not saved
  10. Tap description and enter the description used in step 6 and save
  11. Note description is saved

Expected Result:

Specific description entered using edit multiple must be saved.

Actual Result:

Specific description entered using edit multiple is not saved.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @CortneyOfstad

Activity

  1. added
    DeployBlockerCash
    on Feb 18, 2026
  2. added
    Bug
    on Feb 18, 2026
  3. melvin-bot commented on Feb 18, 2026

    @melvin-bot

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

  4. melvin-bot commented on Feb 18, 2026

    @melvin-bot

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

  5. melvin-bot commented on Feb 18, 2026

    @melvin-bot

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

  6. github-actions commented on Feb 18, 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 Feb 18, 2026

    @OSBotify
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #76264 - "Feat: bulk edit multiple" by @waterim (High confidence)
    Related Issues: None

    Recommendation: REVERT

    The bug is caused by an incorrect data type being passed when saving the description field in bulk edit. The fix would be a simple one-line change, but given this is a new feature that does not exist in production and is blocking the deploy, reverting is the safest approach to unblock the release.

    Labels: No label changes needed. Issue correctly has DeployBlockerCash label as this is a frontend bug in the App repository.

    📋 Detailed Analysis

    Evidence

    PR #76264 introduced the bulk edit functionality for multiple expenses. The issue specifically mentions that when using "edit multiple" to update the description field, the value is not saved. However, when editing the description on a single expense (the normal flow), it works correctly.

    The reproduction steps from the issue clearly show:

    1. Select 2+ expenses
    2. Edit multiple
    3. Enter description as <Shahrukh,khan>
    4. Save
    5. Bug: Description is not saved
    6. Open individual expense and edit description
    7. Works: Description is saved

    This indicates the bug is specific to the bulk edit feature introduced in PR #76264.

    Verification

    I examined the files modified in PR #76264 and found the root cause in /home/runner/_work/App/App/src/pages/Search/SearchEditMultiple/SearchEditMultipleDescriptionPage.tsx:

    Bug location (lines 41-43):

    updateBulkEditDraftTransaction({
        comment: {comment: newDescription},  // WRONG - passing an object
    });

    Correct implementation (as seen in SearchEditMultipleMerchantPage.tsx lines 41-43):

    updateBulkEditDraftTransaction({
        merchant: newMerchant,  // CORRECT - passing a string
    });

    Root Cause

    In the type definition (src/types/onyx/Transaction.ts line 631), TransactionChanges.comment is defined as:

    comment?: string;  // Expects a STRING

    However, SearchEditMultipleDescriptionPage.tsx is passing an object:

    comment: {comment: newDescription}  // Passing an OBJECT

    When getUpdatedTransaction() in src/libs/TransactionUtils/index.ts (lines 683-687) processes this:

    if (Object.hasOwn(transactionChanges, "comment")) {
        updatedTransaction.comment = {
            ...updatedTransaction.comment,
            comment: transactionChanges.comment,  // Expects string, gets object
        };
    }

    This results in the comment being set to an object instead of a string, which is why it does not save correctly. The merchant field works because it correctly passes a string value.

    Fix

    Change line 42 in SearchEditMultipleDescriptionPage.tsx from:

    comment: {comment: newDescription},

    to:

    comment: newDescription,

    While this is a simple one-line fix, reverting the entire PR is recommended since this is a new feature not yet in production and is blocking the deploy.

  8. MelvinBot commented on Feb 18, 2026

    @MelvinBot
    Contributor

    Proposal

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

    When using "edit multiple" (bulk edit) to set a description containing angle brackets (e.g., <Shahrukh,khan>) on selected expenses, the description is not saved. However, editing the same description individually on a single expense works correctly.

    What is the root cause of that problem?

    The bulk edit path in updateMultipleMoneyRequests (src/libs/actions/IOU/index.ts:13775-13807) sends the description as raw text to the API without HTML-escaping it first.

    In contrast, the individual edit path in updateMoneyRequestDescription (src/libs/actions/IOU/index.ts:5826) calls getParsedComment(comment), which uses Parser.replace(text, {shouldEscapeText: true}). This invokes Utils.escapeText() which converts < to &lt; and > to &gt; before the text is sent to the API.

    When the raw string <Shahrukh,khan> (with unescaped angle brackets) reaches the backend, it is interpreted as an HTML tag and stripped, resulting in an empty/missing description. The HTML-escaped version &lt;Shahrukh,khan&gt; used by the individual edit path is stored correctly.

    The data flow in the bulk edit path is:

    1. SearchEditMultipleDescriptionPage stores raw text in draft transaction via updateBulkEditDraftTransaction({comment: {comment: newDescription}})
    2. SearchEditMultiplePage.save() passes draftTransaction.comment.comment (raw text) directly as changes.comment
    3. updateMultipleMoneyRequests sets updates.comment = transactionChanges.comment (still raw text)
    4. The raw text is JSON-stringified and sent to the API — angle brackets are never escaped

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

    In updateMultipleMoneyRequests in src/libs/actions/IOU/index.ts, the changes.comment value should be passed through getParsedComment() before being assigned to transactionChanges.comment. This mirrors what the individual edit path already does.

    The change is around line 13775:

    // Current:
    if (changes.comment && canEditField(...)) {
        transactionChanges.comment = changes.comment;
    }
    
    // Fixed:
    if (changes.comment && canEditField(...)) {
        transactionChanges.comment = getParsedComment(changes.comment);
    }
    

    What alternative solutions did you explore? (Optional)

    An alternative would be to apply the escaping earlier in SearchEditMultipleDescriptionPage.saveDescription() or in SearchEditMultiplePage.save(). However, applying it in updateMultipleMoneyRequests is the most consistent approach since it mirrors where getParsedComment is called in the individual path (updateMoneyRequestDescription), keeping the escaping logic centralized at the API-call level.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.

  9. 15 remaining items

  10. changed the title [-][Due for payment 2026-02-26] Expense - Specific description entered using edit multiple is not saved[/-] [+]Expense - Specific description entered using edit multiple is not saved[/+] on Feb 26, 2026
  11. removed
    Awaiting Payment
    on Feb 26, 2026
  12. marcaaron commented on Feb 26, 2026

    @marcaaron
    Contributor

    We are working on this #82948.

  13. marcaaron commented on Mar 9, 2026

    @marcaaron
    Contributor

    Being tracked in PR #82948 (just merged)

  14. marcaaron commented on Mar 21, 2026

    @marcaaron
    Contributor

    We're working on this in #84756

  15. marcaaron commented on Apr 1, 2026

    @marcaaron
    Contributor

    Fix merged in #84756.

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

Metadata

Metadata

Assignees

Labels

BugEngineeringWeekly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions