Skip to content

Expense - Empty report field can be saved #101806

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: 9.4.91-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: #100735
Email or phone of affected tester (no customers): sjodjoijsonjoinj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Money Requests

Action Performed:

Precondition:

  • Create a text type report field with initial value.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Open the report.
  5. Click on the report field.
  6. Clear it.
  7. Press Enter.
  8. Close the report and reopen.

Expected Result:

In Step 7, after pressing Enter on empty field, report will not scroll up.
In Step 8, user should not be able to save empty report field.

Actual Result:

In Step 7, after pressing Enter on empty field, report scrolls up when error message appears.
In Step 8, empty report field can be saved.
In Step 8, system message shows "changed Text to "" (previously "x")".

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7265676_1790019362325.4.mp4

View all open jobs on GitHub

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

Activity

  1. applause-bot commented on Sep 21, 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/9e2a346147ff5e8809b07c234f7d4ce0247ff7a470c0a0b522bfe9d66b021dc5

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

    @melvin-bot

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

  4. github-actions commented on Sep 21, 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.
  5. melvin-bot commented on Sep 21, 2026

    @melvin-bot

    @Gonals @daledah you have been assigned to this deploy blocker because you reviewed the offending PR: #100735

  6. melvin-bot commented on Sep 21, 2026

    @melvin-bot

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

  7. MelvinBot commented on Sep 21, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: Show up to three report fields per row and edit them inline (Expensify/App#100735) - by @MelvinBot, reviewed/approved by @Gonals and @daledah (High confidence)
    Related Issues: the other five open blockers on this checklist are all attributed to the same PR — Android - Expense - Report field value jumps when navigating from one report to another, Android - Expense - Report auto scrolls to bottom after opening report field, Android - Expense - List dopdown auto closes after focusing on text field and opening list, Expense - Cursor appears briefly on list report field after clicking on it, Expense - No option to remove report field from report after deleting from workspace settings

    Recommendation: REVERT

    PR #100735 replaced the navigate-to-editor report field rows with brand new inline inputs and is the root cause of six separate deploy blockers on this checklist; reverting one feature PR is far safer than landing five or six independent targeted fixes under deploy pressure. If the feature must ship in this release instead, the minimum fix is in saveDraftValue (details below).

    Assigned: @Gonals and @daledah (approving reviewers of #100735) — already assigned by melvin-bot. The PR author is @MelvinBot (bot), so there is no human author to add.
    Labels: No change. DeployBlockerCash stays (an App PR caused this and the fix is in Expensify/App). DeployBlocker was not present, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    • Staging-only, and the repro steps are only possible on staging: before Show up to three report fields per row and edit them inline #100735, tapping a report field in the report view opened DynamicEditReportFieldPage in the RHP. The PR replaced MenuItemWithTopDescription with the new ReportFieldInlineInput, so "click the field, clear it, press Enter" only exists post-PR.
    • Show up to three report fields per row and edit them inline #100735 merged 2026-09-21 09:40 UTC, hours before this was reported at 21:32 UTC in 9.4.91-0.
    • I scanned the other 40 PRs on Deploy Checklist: New Expensify 2026-09-21 — none of them touch report fields, report field validation, or the report view header.
    • The reported system message changed Text to "" (previously "x") is the standard updateReportField optimistic action, which confirms the empty value really went through the normal save path rather than being a display glitch.

    Verification

    Files affected by the bug, all added or rewritten by #100735 (permalinks at 3ddc57b):

    gh pr view 100735 --json files confirms ReportFieldInlineInput.tsx, MoneyRequestViewReportFields.tsx, useSaveReportField.ts and DynamicEditReportFieldPage.tsx are all in the diff.

    Root Cause

    (a) The empty value is saved.
    ReportFieldInlineInput decides whether a field may be emptied from deletable alone:

    ReportFieldInlineInput.tsx#L84

    const isRequired = !reportField.deletable;

    and for a deletable field it deliberately persists the empty string (#L97-L109):

    if (trimmedValue === '') {
        if (isRequired) {
            setValidationError(translate('common.error.fieldRequired'));
            return;
        }
        // Clearing an optional field is a real change, so the empty value is saved.
        setValidationError('');
        setDraftValue('');
        setLastSavedValue('');
        onSaveValue('');
        return;
    }

    That contradicts the app's own definition of a valid report field. getFieldViolation treats every empty report field as a fieldRequired violation, with no deletable check:

    return (reportField.value ?? reportField.defaultValue) ? undefined : CONST.REPORT_VIOLATIONS.FIELD_REQUIRED;

    So the component saves a value it immediately re-renders as an error, which is exactly the pair of symptoms reported. Because the tester saw the value persist and the changed Text to "" system message, their custom text field must have deletable: true, i.e. it took the branch above — the isRequired branch cannot produce a save at all.

    The old editor page gated on the same flag (DynamicEditReportFieldPage.tsx#L136 and #L169), so the underlying leniency is not new — but #100735 is what made it reachable with a single Enter keypress from the report, with the contradictory "is required" error rendered inline right underneath. Unverified inference: I could not confirm the server-side deletable value for a custom text field from the code alone (the optimistic create in ReportField.ts#L226 writes deletable: false), but the observed save proves it resolved to true for the tester's field.

    (b) The report scrolls when the error appears.
    The fields block is the ListHeaderComponent of the report's FlashList, which runs with maintainVisibleContentPosition enabled (MoneyRequestReportUnifiedList.tsx#L340). When the error line renders under the input the header grows by the height of that message; the list compensates to keep the first visible row anchored, and the content visibly jumps. Before #100735 the header was a static stack of menu rows whose violation text only changed while the user was away on the editor page, so it never resized under the user.

    This is made worse by the deferred-error state in the same component (#L64-L86): hasBeenBlurred gates the violation message, and the render-phase sync block resets it to false whenever the saved value prop changes. Saving an empty value changes value, so the error can be shown, hidden and shown again across a few renders — each toggle is another header resize. (Inference: the exact number of toggles depends on Onyx update timing and I did not instrument it; the height-change-drives-scroll mechanism itself is solid.) Sibling blocker Android - Expense - Report auto scrolls to bottom after opening report field is the same family of problem.

    Secondary defect noticed while reading the code (unverified inference): the text branch saves from both onSubmitEditing and onBlur (#L237-L242), and a single-line TextInput blurs on submit. Both handlers run in the same React batch, so the onBlur call still sees the pre-update lastSavedValue and its "skip if unchanged" guard cannot fire — one Enter can dispatch updateReportField twice.

    If you roll forward instead of reverting

    Minimum targeted change in ReportFieldInlineInput.saveDraftValue:

    1. Reject an empty value for all report fields, not just !deletable ones — i.e. drop the if (isRequired) condition and always setValidationError(translate('common.error.fieldRequired')) and return, so the component never saves a value that getFieldViolation will immediately flag. (Alternatively, gate on the same helper rather than on deletable, so there is one definition of "required".)
    2. On blur with an invalid draft, restore draftValue to the last saved value so the input does not sit on a value that was never persisted.
    3. To stop the jump, reserve the error row's height (or keep the field's cell height fixed) so showing/hiding the message does not resize the list header, and stop resetting hasBeenBlurred on every value change.

    That still leaves the other five blockers from this PR unfixed, which is why revert is the recommendation.

  8. Gonals commented on Sep 22, 2026

    @Gonals
    Contributor

    PR Reverted

  9. IuliiaHerets commented on Sep 22, 2026

    @IuliiaHerets

    Chrome / 9.4.91-1
    Passed

    bandicam.2026-09-22.13-40-35-508.mp4
  10. melvin-bot commented on Oct 13, 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.

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

Metadata

Metadata

Assignees

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions