Skip to content

Fix some regression issues of merge expenses#68204

Merged
youssef-lr merged 53 commits intoExpensify:mainfrom
hoangzinh:fix/68189-Unable-to-merge-cash-expense-and-card-transaction
Sep 9, 2025
Merged

Fix some regression issues of merge expenses#68204
youssef-lr merged 53 commits intoExpensify:mainfrom
hoangzinh:fix/68189-Unable-to-merge-cash-expense-and-card-transaction

Conversation

@hoangzinh
Copy link
Contributor

@hoangzinh hoangzinh commented Aug 8, 2025

Explanation of Change

The last time we deployed merge expense PR to staging, we got a few DBs, then we hid "Merge" button to buy time for us to fix those DBs. This PR aims to fix some of them.

Fixed Issues

$ #65574
$ #68189
$ #68197
$ #68196
$ #68206
$ #68243
$ #68225
$ #68170
$ #68180
$ #68195
$ #68171
$ #68233
$ #69598
$ #68178

PROPOSAL:

Tests

Same as QA

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

Case 1: Fix #68189 => Auto select card transaction's amount when merge with cash expense

Precondition:

  • User has card transactions
  1. Go to staging.new.expensify.com
  2. Go to workspace chat that has card transactions.
  3. Open the expense report.
  4. Submit a manual expense in the same report.
  5. Click on the expense from Step 4.
  6. Click More > Merge.
  7. Select any card transaction > Next.
  8. Verify that amount is not displayed in the details step
  9. Complete details step
  10. Verify that amount of the card transaction is auto-selected and displayed in the Confirmation page

Case 2: Fix #68197 => When merging per diem expense with manual expense, receipt cannot be viewed in full screen

Precondition:

  • Workspace has imported per diem rates.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit a per diem expense and a manual expense with receipt.
  4. Open expense report.
  5. Open the per diem expense.
  6. Click More > Merge.
  7. Select the manual expense with receipt > Continue.
  8. Select Receipt 2 from the manual expense > Continue.
  9. Select any detail for other field > Continue.
  10. On confirm page, open the receipt in full screen.
  11. Verify that the receipt will open in full screen.

Case 3: Fix #68196 => Unable to change receipt after opening receipt on confirm page

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit two scan expenses with different receipts.
  4. Wait for scanning to complete.
  5. Open expense report.
  6. Open any scan expense.
  7. Click More > Merge.
  8. Select the other scan expense > Continue.
  9. Select Receipt 2 from the other expense > Continue.
  10. Select any detail for other field > Continue.
  11. On confirm page, open the receipt in full screen.
  12. Close the receipt view.
  13. Click RHP back button twice.
  14. Select Receipt 1.
  15. Verify that Receipt 1 can be selected.

Case 4: Fix #68206 => Amount section does not show negative sign for negative amount in Select details page

  1. Go to OD
  2. Create a report with two expenses with negative amount.
  3. Log in to the same account on ND
  4. Open the expense report.
  5. Open any transaction thread.
  6. Click More > Merge.
  7. Select the other expense > Next.
  8. Verify that Amount section will show negative amount correctly.

Case 5: Fix #68243 => Misaligned radio button with long category name

  1. Open workpace chat
  2. Tap category
  3. Add a long category - Advertisingradhe-krishna-dfgggggghhhhhhh-hhhhhhhhh-hhhhhhhhhghbbnnbbbb-radhe-radherradhe-krishncvbbnhhjjjjjjjh Hbb.com
  4. Create 2 manual expenses with merchant and category. For any one expense select the long category
  5. Open the expense in which long category is not selected
  6. Tap more - merge - select the expense with long category
  7. Verify that long category name must not be misaligned with the radio button

Case 6: Fix #68225 => Merge expense header message is partially hidden when a long merchant name is entered

  1. Go to https://staging.new.expensify.com/home
  2. Open workpace chat
  3. Create a expense with long merchant - Dirty[🥲](https://staging.new.expensify.com/r/1829442022550952)
  4. Create another expense
  5. Open the expense has long merchant
  6. Tap more - merge
  7. Verify that merge expense header message must be fully visible when a long merchant name is entered

Case 7: Fix #68170 Description with mark down shows HTML tags in description selection

  1. Go to workspace chat.
  2. Submit two expenses with description that has mark down to the workspace.
  3. Open expense report.
  4. Open one of the expenses.
  5. Click More > Merge.
  6. Select the expense > Next.
  7. Scroll down to description.
  8. Verify that the description will not show HTML tags.

Case 8: Fix #68180 => Tag in X: Y format is displayed as X/: Y in tag selection section

Precondition:

  • Workspace has at least two tags in X: Y format.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit two expenses with different tag in X: Y format.
  4. Open expense report.
  5. Open the transaction thread from any expense.
  6. Click More > Merge.
  7. Select the other expense.
  8. Click Continue.
  9. Scroll down to Tag.
  10. Verify that Tag in X: Y format will be displayed as X: Y.

Case 9: Fix #68171 => Amount in the merged expense in self DM shows negative value
Precondition:

  • Account has self DM.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense to the workspace.
  4. Go to self DM.
  5. Track a manual expense in self DM.
  6. Open the transaction thread in self DM.
  7. Click More > Merge.
  8. Select the workspace expense > Next.
  9. Select the amount from the workspace expense in Step 3.
  10. Select any option for other fields.
  11. Click Continue.
  12. Click Merge expenses.
  13. Verify that the amount in the merged expense in self DM shows a positive value.

Case 10: Fix #68233 => Today's date is used instead of the original date of the selected expense

  1. Go to staging.new.expensify.com
  2. Create 2 scan expenses in an IOU chat
  3. Wait until scanning is completed
  4. Go to any of the scan expenses
  5. Tap on the More button > Merge
  6. Select another scan expense that is in the same report
  7. Select any receipt
  8. Select any amount and merchant
  9. Note the expense date in the Confirm details page
  10. Tap on "Merge expense"
  11. Verify that the expense's date shown on the Confirm Details page remains unchanged on the Expense Details page
  • 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
    • MacOS: Desktop
  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
Screen.Recording.2025-08-19.at.23.08.05.android.mp4
Android: mWeb Chrome
Screen.Recording.2025-08-19.at.23.00.22.android.chrome.1.mov
iOS: Native
Screen.Recording.2025-08-19.at.23.30.36.mp4
iOS: mWeb Safari
Screen.Recording.2025-08-19.at.23.25.30.ios.safari.mov
MacOS: Chrome / Safari
Screen.Recording.2025-08-19.at.22.26.30.web.1.mp4
Screen.Recording.2025-08-19.at.22.45.30.web.2.mov
MacOS: Desktop
Screen.Recording.2025-08-19.at.22.52.54.desktop.mp4

francoisl added a commit that referenced this pull request Sep 11, 2025
…merge-cash-expense-and-card-transaction"

This reverts commit 2a773ff, reversing
changes made to c18c6cf.
@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/youssef-lr in version: 9.2.11-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 9.2.12-4 🚀

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

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

Projects

None yet

5 participants