Skip to content

[Due for payment 2026-06-19] Invoices - Report field changes are not saved when edited offline #93233

Closed

Description

@applause-bot

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.4.5-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: #73887
Email or phone of affected tester (no customers): odjosdjosjnojdiosj@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:

  • Enable Invoices in workspace settings.
  • User has created a text type invoice field in workspace settings > Invoices > Invoice fields.
  1. Go to staging.new.expensify.com
  2. Open FAB > Send invoice.
  3. Send an invoice to any user.
  4. Open the invoice report.
  5. Go offline.
  6. Open the text report field.
  7. Edit and save it.

Expected Result:

The report field changes will be saved when edited offline.

Actual Result:

The report field changes are not saved when edited offline.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7177423_1781135479862.4.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7177423

Activity

  1. applause-bot commented on Jun 11, 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/e14cb11b3dfb6f37ba94a6f1a34358b6f5b8a5fbcfcb3ef98d00c104ec379b0c

  2. added
    DeployBlockerCash
    Bug
    on Jun 11, 2026
  3. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  4. melvin-bot commented on Jun 11, 2026

    @melvin-bot

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

  5. github-actions commented on Jun 11, 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.
  6. MelvinBot commented on Jun 11, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    For invoice reports, report field values are read from reportNameValuePairs (the REPORT_NAME_VALUE_PAIRS Onyx collection), but the save action writes its optimistic update only to report.fieldList. The two sides disagree, so an offline edit never surfaces.

    The read path resolves invoice field values from the NVP collection in getReportFieldMaps:

    const shouldReadReportNameValuePair = report?.type === CONST.REPORT.TYPE.INVOICE && field.target === CONST.REPORT_FIELD_TARGETS.INVOICE;
    const reportNameValuePairField = shouldReadReportNameValuePair ? (getReportFieldFromReportNameValuePairs(...)) : undefined;
    fieldValues[key] = reportNameValuePairField?.value ?? field.value ?? field.defaultValue ?? '';

    But the write path, updateReportField, only merges optimistic data into report.fieldList[fieldKey] — it never touches REPORT_NAME_VALUE_PAIRS.

    This is why the bug is invoice-only and offline-only:

    • Online: the backend (SetReportField) updates the invoice NVP and Pusher syncs it back, so the new value appears — masking the gap.
    • Offline: only the optimistic update runs. It writes to report.fieldList, which the invoice view ignores in favor of the (unchanged) NVP value, so the edit looks like it was never saved.

    The same asymmetry exists on the edit page, which also reads the field from the NVP first (DynamicEditReportFieldPage.tsx:61-63).

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

    In updateReportField, when the report is an invoice report and the field targets invoice (report.type === CONST.REPORT.TYPE.INVOICE && reportField.target === CONST.REPORT_FIELD_TARGETS.INVOICE), add the optimistic update to the REPORT_NAME_VALUE_PAIRS collection so the write lands where the invoice view reads:

    • optimisticData: MERGE into ${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID} with the updated field stored under the same key the reader uses (fieldKey, i.e. expensify_field_<id> — see getReportFieldFromReportNameValuePairs).
    • failureData: MERGE the previousReportField back into the same NVP key to roll back on failure.

    Keep the existing report.fieldList writes for non-invoice (expense) reports unchanged.

    Investigation details & alternatives considered
    • Alternative considered — make the view read report.fieldList for invoices too: rejected. The NVP read was added deliberately for invoice fields (the online value comes back via NVP), so changing the read path would break the online/synced case. Aligning the write to the read is the smaller, safer change.
    • Why not the title field: the title path uses updateReportName, a separate code path, and isn't affected.
    • Scope match: the fix (add an NVP optimistic/failure entry for invoice fields) matches the bug scope exactly — invoice + offline.
    • Confirmed target === CONST.REPORT_FIELD_TARGETS.INVOICE is the same condition gating the NVP read in getReportFieldMaps.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/93233) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  7. melvin-bot commented on Jun 11, 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.

  8. melvin-bot commented on Jun 11, 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.

  9. mollfpr commented on Jun 11, 2026

    @mollfpr
    Contributor

    Closing — the invoice fields feature has been reverted, so this no longer reproduces on staging.

  10. removed
    DeployBlockerCash
    on Jun 11, 2026
  11. added
    Daily
    and removed
    Hourly
    on Jun 12, 2026
  12. changed the title [-]Invoices - Report field changes are not saved when edited offline[/-] [+][Due for payment 2026-06-19] Invoices - Report field changes are not saved when edited offline[/+] on Jun 12, 2026
  13. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.6-4 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-06-19. 🎊

  14. melvin-bot commented on Jun 12, 2026

    @melvin-bot

    @mollfpr 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]. 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

Assignees

Labels

BugDailyEngineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions