Skip to content

feat: Allow admins to merge approved reports - #102712

Merged
Beamanator merged 22 commits into
Expensify:mainfrom
dmkt9:fix/100399
Nov 2, 2026
Merged

Beamanator merged 22 commits into
Expensify:mainfrom
dmkt9:fix/100399

Conversation

@dmkt9

@dmkt9 dmkt9 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Allows workspace admins to merge expense reports that are already in the Approved state while preserving the existing merge constraints (same submitter, workspace, state, manager, and write access). Paid/reimbursed and Closed reports remain ineligible.

The merge RHP also shows an informational heads-up when any selected report is already exported or has an export pending. Export state is resolved from both live Onyx data and the current Search snapshot so the warning still works when report actions have not been hydrated yet. The warning does not disable Confirm.

Fixed Issues

$ #100399
PROPOSAL:

Tests

  1. Sign in as a workspace admin.
  2. Prepare at least two expense reports from the same submitter, in the same workspace, with the same approver/managerID, and move both reports to Approved.
  3. Go to Search > Reports, select both Approved reports, and verify Merge Reports is available.
  4. Open the Merge Reports RHP, select the destination report, and verify Confirm is enabled.
  5. Export one of the selected reports to a connected accounting integration (or use a report that was already exported), reopen the Merge Reports RHP, and verify a Heads up warning is shown above Confirm.
  6. Verify the warning is informational and Confirm remains enabled.
  7. Confirm the merge and verify the destination report remains Approved and payable, while the source report is removed after the merge completes.
  8. Repeat with a non-admin user and verify two Approved reports cannot be merged.
  • Verify that no errors appear in the JS console

Offline tests

Same as the Tests

QA Steps

Same as the Tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
chrome.mp4
chrome-report-field.mp4

@melvin-bot

melvin-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/ReportUtils.ts 90.24% <93.18%> (+0.03%) ⬆️
src/pages/Search/SearchReportsMergeReports.tsx 0.00% <0.00%> (ø)
... and 10 files with indirect coverage changes

@dmkt9 dmkt9 changed the title [WIP] feat: Allow admins to merge approved reports feat: Allow admins to merge approved reports Oct 6, 2026
@dmkt9
dmkt9 marked this pull request as ready for review October 6, 2026 03:14
@dmkt9
dmkt9 requested review from a team as code owners October 6, 2026 03:14
@melvin-bot
melvin-bot Bot requested review from garrettmknight and situchan and removed request for a team October 6, 2026 03:15
@melvin-bot

melvin-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team October 6, 2026 03:15
@dmkt9

dmkt9 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@garrettmknight Could you please trigger this? #102712 (comment)

@OSBotify

This comment has been minimized.

@MelvinBot

Copy link
Copy Markdown
Contributor

@dmkt9 I updated the OP of #100399 to add a report field check (see Scope #5). Right now canMergeReports and mergeReports don't read report fields. If the selected reports have different values, the merge goes through and the source reports' values are lost.

Please add this check to the PR. If any report field value differs across the selected reports, block the merge and show this error:

These reports have different report field values. To merge them, make the report fields match on each report first.

Use this one error for every case. Skip formula fields in the comparison, since nobody can edit them.

@situchan

situchan commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

This is on hold for BE implementation, right?

@dmkt9 dmkt9 changed the title feat: Allow admins to merge approved reports [HOLD BE] feat: Allow admins to merge approved reports Oct 8, 2026
@OSBotify

OSBotify commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 0605eb12..acafb1c9 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -10157,8 +10157,8 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
             title: 'Berichte zusammenführen',
             description: 'Wählen Sie den Bericht aus, der beibehalten werden soll. Alle Ausgaben werden in ihn verschoben und die anderen Berichte werden gelöscht.',
             exportedWarning:
-                'Mindestens einer der ausgewählten Berichte wurde bereits in eine Buchhaltungsintegration exportiert. Wenn die Berichte zusammengeführt und erneut exportiert werden, können doppelte Daten entstehen.',
-            reportFieldsMismatch: 'Diese Berichte haben unterschiedliche Berichtsfeldwerte. Um sie zusammenzuführen, gleiche zuerst die Berichtsfelder in allen Berichten an.',
+                'Ein oder mehrere ausgewählte Berichte wurden bereits an eine Buchhaltungsintegration exportiert. Das Zusammenführen kann zu doppelten Daten führen, wenn sie erneut exportiert werden.',
+            reportFieldsMismatch: 'Diese Berichte haben unterschiedliche Berichtsfeldwerte. Um sie zusammenzuführen, passen Sie zuerst die Berichtsfelder in jedem Bericht aneinander an.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} bisher`,
         weekOf: ({date}: {date: string}) => `Woche vom ${date}`,
diff --git a/src/languages/el.ts b/src/languages/el.ts
index ee0a01f9..f76ea9ed 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -10348,8 +10348,8 @@ ${reportName}`,
             title: 'Συγχώνευση αναφορών',
             description: 'Επιλέξτε την αναφορά που θέλετε να κρατήσετε. Όλες οι δαπάνες θα μετακινηθούν σε αυτήν και οι άλλες αναφορές θα διαγραφούν.',
             exportedWarning:
-                'Μία ή περισσότερες επιλεγμένες αναφορές έχουν ήδη εξαχθεί σε μια λογιστική ενσωμάτωση. Η συγχώνευσή τους μπορεί να προκαλέσει διπλότυπα δεδομένα αν εξαχθούν ξανά.',
-            reportFieldsMismatch: 'Αυτές οι αναφορές έχουν διαφορετικές τιμές στα πεδία αναφοράς. Για να τις συγχωνεύσετε, αντιστοιχίστε πρώτα τις τιμές των πεδίων σε κάθε αναφορά.',
+                'Μία ή περισσότερες από τις επιλεγμένες αναφορές έχουν ήδη εξαχθεί σε μια λογιστική διασύνδεση. Η συγχώνευσή τους μπορεί να προκαλέσει διπλά δεδομένα αν εξαχθούν ξανά.',
+            reportFieldsMismatch: 'Αυτές οι αναφορές έχουν διαφορετικές τιμές στα πεδία αναφοράς. Για να τις συγχωνεύσετε, κάντε πρώτα τα πεδία αναφοράς να ταιριάζουν σε κάθε αναφορά.',
         },
         goTo: ({destination}: {destination: string}) => `Μετάβαση στο ${destination}`,
         mySavedSearch: 'Οι δαπάνες μου',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 784afd27..f53d9cc3 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -9975,7 +9975,7 @@ ${reportName}`,
             title: 'Combinar informes',
             description: 'Selecciona el informe que quieres conservar. Todos los gastos se moverán a él y los demás informes se eliminarán.',
             exportedWarning: 'Uno o más informes seleccionados ya se han exportado a una integración contable. Combinarlos puede causar datos duplicados si se vuelven a exportar.',
-            reportFieldsMismatch: 'Estos informes tienen valores de campos de informe diferentes. Para combinarlos, primero haz que los campos coincidan en cada informe.',
+            reportFieldsMismatch: 'Estos informes tienen diferentes valores en los campos del informe. Para combinarlos, haz que los campos del informe coincidan en cada informe primero.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} hasta ahora`,
         weekOf: ({date}: {date: string}) => `Semana del ${date}`,
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index e98244da..88a0dd99 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -10181,8 +10181,9 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
             title: 'Fusionner des notes de frais',
             description: 'Sélectionnez la note de frais à conserver. Toutes les dépenses y seront déplacées et les autres notes de frais seront supprimées.',
             exportedWarning:
-                'Une ou plusieurs notes de frais sélectionnées ont déjà été exportées vers une intégration comptable. Les fusionner peut créer des données en double si elles sont exportées à nouveau.',
-            reportFieldsMismatch: 'Ces notes de frais ont des valeurs de champs différentes. Pour les fusionner, commencez par faire correspondre les champs de chaque note de frais.',
+                'Une ou plusieurs notes de frais sélectionnées ont déjà été exportées vers une intégration comptable. Les fusionner peut entraîner des doublons si elles sont exportées de nouveau.',
+            reportFieldsMismatch:
+                'Ces notes de frais ont des valeurs de champ de note de frais différentes. Pour les fusionner, faites d’abord correspondre les champs de note de frais sur chaque note de frais.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} jusqu’à présent`,
         weekOf: ({date}: {date: string}) => `Semaine du ${date}`,
diff --git a/src/languages/it.ts b/src/languages/it.ts
index a07391f2..a14f2188 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -10109,8 +10109,8 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
         mergeReports: {
             title: 'Unisci report',
             description: 'Seleziona il report da mantenere. Tutte le spese verranno spostate al suo interno e gli altri report verranno eliminati.',
-            exportedWarning: 'Uno o più report selezionati sono già stati esportati in un’integrazione contabile. Unirli potrebbe causare dati duplicati se vengono esportati di nuovo.',
-            reportFieldsMismatch: 'Questi report hanno valori dei campi diversi. Per unirli, fai prima in modo che i campi corrispondano in ogni report.',
+            exportedWarning: 'Uno o più report selezionati sono già stati esportati in un’integrazione contabile. Fonderli potrebbe causare dati duplicati se vengono esportati di nuovo.',
+            reportFieldsMismatch: 'Questi report hanno valori diversi nei campi del report. Per unirli, prima fai in modo che i campi del report coincidano in ogni report.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} finora`,
         weekOf: ({date}: {date: string}) => `Settimana del ${date}`,
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 153d4f1d..e890f427 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -9959,8 +9959,8 @@ ${reportName}`,
         mergeReports: {
             title: 'レポートをマージする',
             description: '保持するレポートを選択してください。すべての経費はそのレポートに移動され、他のレポートは削除されます。',
-            exportedWarning: '選択したレポートのうち1つ以上は、すでに会計連携にエクスポートされています。マージ後に再度エクスポートすると、データが重複する可能性があります。',
-            reportFieldsMismatch: 'これらのレポートではレポートフィールドの値が異なります。マージするには、まず各レポートのレポートフィールドを一致させてください。',
+            exportedWarning: '選択したレポートのうち1件以上は、すでに会計連携へエクスポートされています。これらをマージすると、再度エクスポートした際にデータが重複する可能性があります。',
+            reportFieldsMismatch: 'これらのレポートには異なるレポートフィールドの値があります。レポートをマージするには、まず各レポートのレポートフィールドを同じ値にそろえてください。',
         },
         periodSoFar: ({period}: {period: string}) => `これまでの${period}`,
         weekOf: ({date}: {date: string}) => `${date} の週`,
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 7fb21d4a..fe0b884a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -10077,8 +10077,9 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
             title: 'Rapporten samenvoegen',
             description: 'Selecteer het rapport dat je wilt behouden. Alle uitgaven worden daarheen verplaatst en de andere rapporten worden verwijderd.',
             exportedWarning:
-                'Een of meer geselecteerde rapporten zijn al geëxporteerd naar een boekhoudintegratie. Als je ze samenvoegt en opnieuw exporteert, kunnen dubbele gegevens ontstaan.',
-            reportFieldsMismatch: 'Deze rapporten hebben verschillende rapportveldwaarden. Maak eerst de rapportvelden in elk rapport gelijk om ze samen te voegen.',
+                'Een of meer geselecteerde rapporten zijn al geëxporteerd naar een boekhoudintegratie. Deze samenvoegen kan dubbele gegevens veroorzaken als ze opnieuw worden geëxporteerd.',
+            reportFieldsMismatch:
+                'Deze rapporten hebben verschillende waarden voor rapportvelden. Om ze te combineren, zorg je er eerst voor dat de rapportvelden in elk rapport overeenkomen.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} tot nu toe`,
         weekOf: ({date}: {date: string}) => `Week van ${date}`,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 04a57835..66713bc8 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -10092,8 +10092,8 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
             title: 'Połącz raporty',
             description: 'Wybierz raport, który chcesz zachować. Wszystkie wydatki zostaną do niego przeniesione, a pozostałe raporty zostaną usunięte.',
             exportedWarning:
-                'Co najmniej jeden z wybranych raportów został już wyeksportowany do integracji księgowej. Scalenie raportów może spowodować duplikację danych, jeśli zostaną ponownie wyeksportowane.',
-            reportFieldsMismatch: 'Te raporty mają różne wartości pól raportu. Aby je scalić, najpierw ustaw takie same wartości pól w każdym raporcie.',
+                'Co najmniej jeden z wybranych raportów został już wyeksportowany do integracji księgowej. Połączenie ich może spowodować zduplikowanie danych, jeśli zostaną wyeksportowane ponownie.',
+            reportFieldsMismatch: 'Te raporty mają różne wartości pól raportu. Żeby je scalić, najpierw ustaw identyczne pola raportu w każdym raporcie.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} do tej pory`,
         weekOf: ({date}: {date: string}) => `Tydzień od ${date}`,
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index f3181fa8..6aea65e1 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -10074,8 +10074,9 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
         mergeReports: {
             title: 'Mesclar relatórios',
             description: 'Selecione o relatório que você quer manter. Todas as despesas serão movidas para ele e os outros relatórios serão excluídos.',
-            exportedWarning: 'Um ou mais relatórios selecionados já foram exportados para uma integração contábil. Mesclá-los pode causar dados duplicados se forem exportados novamente.',
-            reportFieldsMismatch: 'Estes relatórios têm valores de campos de relatório diferentes. Para mesclá-los, primeiro faça os campos corresponderem em cada relatório.',
+            exportedWarning: 'Um ou mais relatórios selecionados já foram exportados para uma integração contábil. Unificá-los pode causar dados duplicados se forem exportados novamente.',
+            reportFieldsMismatch:
+                'Esses relatórios têm valores diferentes nos campos do relatório. Para mesclá-los, faça com que os campos do relatório correspondam em cada relatório primeiro.',
         },
         periodSoFar: ({period}: {period: string}) => `${period} até agora`,
         weekOf: ({date}: {date: string}) => `Semana de ${date}`,
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 0a492b99..6031465b 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -9695,8 +9695,8 @@ ${reportName}`,
         mergeReports: {
             title: '合并报表',
             description: '选择要保留的报表。所有费用都将移入该报表,其他报表将被删除。',
-            exportedWarning: '一个或多个选定报表已导出到会计集成。如果再次导出,合并这些报表可能会导致重复数据。',
-            reportFieldsMismatch: '这些报表的报表字段值不同。要合并它们,请先使每个报表中的报表字段保持一致。',
+            exportedWarning: '一个或多个选中的报表已导出到会计集成中。如果再次导出,合并它们可能会导致数据重复。',
+            reportFieldsMismatch: '这些报表包含不同的报表字段值。要合并它们,请先让每个报表中的报表字段保持一致。',
         },
         periodSoFar: ({period}: {period: string}) => `目前 ${period}`,
         weekOf: ({date}: {date: string}) => `${date} 当周`,

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@dmkt9 dmkt9 changed the title [HOLD BE] feat: Allow admins to merge approved reports feat: Allow admins to merge approved reports Oct 14, 2026
@dmkt9

dmkt9 commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

@situchan This PR is ready for review. The ts failure is unrelated to our changes

@dmkt9

dmkt9 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@situchan Thanks! I've updated this PR. Could you take another look when you get a chance?

@MelvinBot

Copy link
Copy Markdown
Contributor

Review

All earlier review feedback is addressed, and I found no blocking bugs at 4d3a4f06. Two items need a decision before merge, plus one optional fix.

1. Please confirm: the report field check passes when field values haven't loaded

ReportUtils.ts:15358 reads each report's fieldList. When a report has no fieldList, getAvailableReportFields returns the policy fields, so the check compares default values instead of saved ones.

The merge page takes fieldList from the live report, then from the Search snapshot (SearchReportsMergeReports.tsx:127). No other Search code reads fieldList from the snapshot, so I can't confirm the Search API sends it.

Possible failure: you select two reports you haven't opened in this session. One is saved with "A" and the other with "B". If neither has fieldList loaded, both resolve to the default, the check passes, and the merge drops the source report's value.

Ask: confirm that Search results include fieldList for expense reports. If they don't, treat a missing fieldList as "not loaded" while the policy has report fields enabled, and keep Confirm disabled until it loads.

2. Open question: backend support for Approved merges

situchan asked whether this PR is on hold for backend work, and I don't see an answer. The client now sends Approved reports to MergeReports. Please confirm the backend accepts them and keeps the destination Approved, as test step 7 expects.

3. Optional: the optimistic next step can show the wrong text on Approved destinations

Transaction.ts:2058-2065 updates total but not reimbursableTotal or nonReimbursableTotal. The Approved next step uses the reimbursable total.

Example: you merge reimbursable expenses into an Approved report that has only card expenses. The next step shows "No further action" instead of "Waiting to pay" until the server responds. Only Approved destinations hit this path. To fix it, copy the updated reimbursable totals into updatedReport.

Earlier feedback that is now addressed
  • Approved reports with isWaitingOnBankAccount or isWaitingForCancelledReimbursement are rejected, and tests cover both flags.
  • Tests now cover merging two reimbursed reports.
  • updateReportField and the mergeReports guard are no longer changed, which removes the externalID API change and the duplicated lookup.
  • The page validates the snapshot-first reportItems again. Only fieldList comes from the live report.
  • Hidden fields and fields with Report fields turned off are skipped, and tests cover both cases.
  • The export warning now reads pendingFields.export from the live report.
  • The error copy is bold, shouldValidateReportFields is gone, and the .github/actions changes are reverted.
  • The only failing check is Check independent approval.

@melvin-bot
melvin-bot Bot requested a review from Beamanator October 29, 2026 12:11
@MelvinBot

Copy link
Copy Markdown
Contributor

Regression check

I found one regression at 4d3a4f06: trailing spaces in a text report field can block an Open or Processing merge that works on main. I traced this in code and didn't run the app.

Text fields that differ only by spaces block the merge, and the user can't fix it

ReportUtils.ts:15358 compares text values exactly. However, the app saves text fields untrimmed (ReportFieldInlineInput.tsx:107). It also skips any save where only spaces change (ReportFieldInlineInput.tsx:112 and DynamicEditReportFieldPage.tsx:125).

Example: Report A has the field set to "Project X " with a trailing space, and report B has "Project X".

  • Merge RHP: Both reports look identical, but the mismatch error appears and Confirm is disabled.
  • Fixing it: Removing the trailing space doesn't save. The user has to change the value to something else and then change it back.
  • On main: The merge goes through.

Fix: Trim text values before comparing them in doReportsHaveMatchingReportFieldValues. Add a test for this case.

Other cases I checked that are not regressions
  • Field deleted from the workspace: It stays on older reports, so the field counts differ and the merge is blocked. The user can remove the field from the older report with its delete button, which makes the reports match.
  • Field newly added to the workspace: Both unsettled reports get it with the same default value.
  • Submitters and managers: Anyone who can merge the reports can also edit their fields, so they can resolve a mismatch.
  • Merging expenses (not reports): These callers of isMoneyRequestReportEligibleForMerge don't pass the new flag, so Approved reports stay excluded for them.
  • Approved reports in the bulk Merge option: This is the intended new behavior.
  • Date fields: I found no format differences in the App code. Dates saved from Classic could be stored in another format, but I couldn't confirm that.
  • Loading: The fallback when fieldList hasn't loaded is still open, from my previous review. It can block a merge on main's behavior or let a mismatch through, depending on whether Search results include fieldList.

@situchan

Copy link
Copy Markdown
Contributor

Please check #102712 (comment)

@Beamanator

Copy link
Copy Markdown
Contributor

@dmkt9 thoughts on #102712 (comment)?

@dmkt9

dmkt9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Resolved

@Beamanator

Copy link
Copy Markdown
Contributor

dang another merge conflict :/

@dmkt9

dmkt9 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

dang another merge conflict :/

Thanks. Resolved

@Beamanator Beamanator left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Beamanator
Beamanator merged commit 705fc00 into Expensify:main Nov 2, 2026
38 of 39 checks passed
@OSBotify

OSBotify commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚧 Beamanator has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@OSBotify OSBotify mentioned this pull request Nov 2, 2026
75 tasks done
@OSBotify

OSBotify commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.28-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. The Merge reports bulk action is only shown when the REPORT_MERGE beta is enabled (src/hooks/useSearchBulkActions.ts:3117). This means letting admins merge Approved reports, and the new export and report-field messages, are still beta-only. No help article covers merging reports yet.


view run

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Beamanator in version: 9.5.30-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.30-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants