Skip to content

Conversation

@whiletrace
Copy link
Contributor

…from issue 74713

Explanation of Change

This change Parses HTML ofunReportedTransactionMessages in the getreportNames() solving the regression that pull request from #68721 (comment) created as well as implementing the original changes of the PR: conditional Parsing of HTML at the displayNames component

Fixed Issues

$ #68721 (comment)
$ #74713
PROPOSAL: #68721 (comment)

Tests

  1. Launch app
  2. 2 click actions button on left of screen marked +
  3. select create chat from the menu
  4. in the form field that appears enter a user name, email, or phone
  5. matching user will appear below form field
  6. click button right side of the user entry which will be labeled add to group
  7. on bottom Left of screen click green button labeled next
  8. Click on Group Name
  9. Delete previous entry
  10. Enter < > as the group name
  11. Click Save
  12. note preview contains the saved group name < >
  13. Click Create group
  14. Note Header will have New Group name < >
  15. Click Header
  16. Note detail will show group name: < >

Additional steps to cover Regression bug

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Open the transaction thread.
  5. Click Report.
  6. Click Remove from report.
  7. Go to self DM.
  8. Open the unreported expense.
  9. Right click on "moved this expense to your personal space" system message.
  10. Click Reply in thread.
  11. Note "moved this expense to your personal space" system message will not show HTML tags in thread header.
  • Verify that no errors appear in the JS console

Offline tests

  1. Launch app
  2. 2 click actions button on left of screen marked +
  3. select create chat from the menu
  4. in the form field that appears enter a user name, email, or phone
  5. matching user will appear below form field
  6. click button right side of the user entry which will be labeled add to group
  7. on bottom Left of screen click green button labeled next
  8. Click on Group Name
  9. Delete previous entry
  10. Enter < > as the group name
  11. Click Save
  12. note preview contains the saved group name < >
  13. Click Create group
  14. Note Header will have New Group name < >
  15. Click Header
  16. Note detail will show group name: < >

Additional steps to cover Regression bug

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create an expense.
  4. Open the transaction thread.
  5. Click Report.
  6. Click Remove from report.
  7. Go to self DM.
  8. Open the unreported expense.
  9. Right click on "moved this expense to your personal space" system message.
  10. Click Reply in thread.
  11. Note "moved this expense to your personal space" system message will not show HTML tags in thread header.

QA Steps

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

  • 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 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 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
android.mp4
androidreg
Android: mWeb Chrome
compressed.mp4
androidmobileweb
iOS: Native
ioscomressed.mp4
iosmobileregress
iOS: mWeb Safari
safari-mobileweb.mp4
mobilesafariweb
MacOS: Chrome / Safari
chrome.mp4
regressionscreenshot
MacOS: Desktop
macappcompressed.mp4
macdesk

@whiletrace whiletrace requested review from a team as code owners November 12, 2025 11:49
@melvin-bot melvin-bot bot requested review from brunovjk and joekaufmanexpensify and removed request for a team November 12, 2025 11:49
@melvin-bot
Copy link

melvin-bot bot commented Nov 12, 2025

@brunovjk 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]

@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 12, 2025

full disclosure I did receive console errors when testing Android Native and IOS Native, I do not believe they were related to the PR, my test environment working through remote desktop on a scaleways cloud apple Instance. the Errors I saw were [Onyx] warning:Trying to apply "merge"with array, as well as [Onyx] use Onyx returned to no data for key
Screenshot_1762921153
Simulator Screenshot - iPhone 16 Plus - 2025-11-12 at 11 25 26
Simulator Screenshot - iPhone 16 Pro - 2025-11-12 at 10 15 25

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

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

Files with missing lines Coverage Δ
src/components/DisplayNames/index.native.tsx 100.00% <100.00%> (+11.11%) ⬆️
src/libs/ReportUtils.ts 75.56% <ø> (+16.12%) ⬆️
src/pages/ReportDetailsPage.tsx 59.42% <100.00%> (+0.11%) ⬆️
src/components/DisplayNames/index.tsx 0.00% <0.00%> (ø)
... and 464 files with indirect coverage changes

@joekaufmanexpensify
Copy link
Contributor

@QichenZhu should you be reviewer here since you reviewed the first try PR? #74254

Copy link
Contributor

@joekaufmanexpensify joekaufmanexpensify left a comment

Choose a reason for hiding this comment

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

good from a product perspective 👍

@whiletrace
Copy link
Contributor Author

I was also going to request that @QichenZhu be assigned for that very reason

@joekaufmanexpensify joekaufmanexpensify requested review from QichenZhu and removed request for brunovjk November 12, 2025 17:34
Copy link
Contributor

@QichenZhu QichenZhu left a comment

Choose a reason for hiding this comment

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

@whiletrace, the previous PR was reverted, so could you reapply it here? Thanks!

@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 13, 2025

@whiletrace, the previous PR was reverted, so could you reapply it here? Thanks!

Yes, Ill get the original commits reinstated and on the diff by EOD 11/13/2025, sorry for the delay.

whiletrace and others added 5 commits November 13, 2025 19:20
left over from refactor  comment is no longer accurate

Co-authored-by: Qichen Zhu <[email protected]>
refactoring based upon correct pattern usage

Co-authored-by: Qichen Zhu <[email protected]>
@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 14, 2025

@QichenZhu
all changes from revert are reinstated and now showing in the diffs, this should be ready to go.

Copy link
Contributor

@QichenZhu QichenZhu left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix. Have a good weekend!

@whiletrace
Copy link
Contributor Author

Thanks for the quick fix. Have a good weekend!

no problem @QichenZhu you as well! thanks again for the support its been
fun working with you on this.

@carlosmiceli carlosmiceli merged commit d8bbc0a into Expensify:main Nov 17, 2025
27 checks passed
@OSBotify
Copy link
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.

@samranahm
Copy link
Contributor

@whiletrace Seems like we have a lint error here

/home/runner/work/App/App/tests/unit/DisplayNamesShouldParseHTMLTest.tsx
Error: 24:25 error Prefer String#replaceAll() over String#replace() unicorn/prefer-string-replace-all

@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 17, 2025

@samranahm I can look at it this afternoon about 15:00 Pacific Standard Time.

@whiletrace
Copy link
Contributor Author

@samranahm I can look at it this afternoon about 15:00 Pacific Standard Time.

@QichenZhu @carlosmiceli since this is merged, What is recommended process, can I fix and push?

@carlosmiceli
Copy link
Contributor

Yes, submit a new PR and link to the original issue. Thank you!

@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 17, 2025

Yes, submit a new PR and link to the original issue. Thank you!

@carlosmiceli for a lint-only fix, do you need me to go through the full testing checklist again, or can I just fix the lint error and note that no functional changes were made?

@carlosmiceli
Copy link
Contributor

We should still test just in case.

@whiletrace
Copy link
Contributor Author

@carlosmiceli okay I'll get on it I can put my new m1 through its paces.

@whiletrace
Copy link
Contributor Author

whiletrace commented Nov 18, 2025

@carlosmiceli okay I pulled from Expensify main rebased unto my dev branch and created a new branch for the PR trying to recreate Lint error now.

@QichenZhu
Copy link
Contributor

All sorted here: #75347

@whiletrace @samranahm

@whiletrace
Copy link
Contributor Author

All sorted here: #75347

@whiletrace @samranahm

Thank you @QichenZhu as well as @roryabraham

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.60-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.60-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/carlosmiceli in version: 9.2.60-0 🚀

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

@whiletrace
Copy link
Contributor Author

@carlosmiceli @QichenZhu
I am testing for the solution of 111864 but the steps recreate the bug state that to open a buisness and personal bank account how can I do that using mock accounts for my test users?

@QichenZhu
Copy link
Contributor

@whiletrace, you can use these credentials: https://expensify.slack.com/archives/C01GTK53T8Q/p1711049879962529

@whiletrace
Copy link
Contributor Author

update created draft PR here

mountiny pushed a commit that referenced this pull request Nov 19, 2025
mountiny added a commit that referenced this pull request Nov 19, 2025
[CP Staging] [No QA] Revert #74928 "implemented HTML parsing for getReportNames()/ Conditional Parsing for Displaynames"
@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.2.60-2 🚀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants