-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: system message shows html #79755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.INTEGRATION_SYNC_FAILED)) { | ||
| return getIntegrationSyncFailedMessage(translate, parentReportAction, report?.policyID); | ||
| return Parser.htmlToText(getIntegrationSyncFailedMessage(translate, parentReportAction, report?.policyID)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ CONSISTENCY-3 (docs)
The fix for stripping HTML from system messages is incomplete. The COMPANY_CARD_CONNECTION_BROKEN action type at line 546 also returns HTML (contains <a href=...>log into your bank</a>) but was not fixed.
Fix: Apply the same Parser.htmlToText() wrapper to maintain consistency:
if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.COMPANY_CARD_CONNECTION_BROKEN)) {
return Parser.htmlToText(getCompanyCardConnectionBrokenMessage(translate, parentReportAction));
}|
|
||
| if (isActionOfType(parentReportAction, CONST.REPORT.ACTIONS.TYPE.INTEGRATION_SYNC_FAILED)) { | ||
| return getIntegrationSyncFailedMessage(translate, parentReportAction, report?.policyID); | ||
| return Parser.htmlToText(getIntegrationSyncFailedMessage(translate, parentReportAction, report?.policyID)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ CONSISTENCY-3 (docs)
The fix is incomplete - other similar message functions that also return HTML were not updated. Specifically:
- Line 546:
getCompanyCardConnectionBrokenMessage()returns HTML (<a href=...>log into your bank</a>) - Line 495:
getMovedActionMessage()returns HTML (<a href=...>moved this report to the ... workspace</a>)
Both should also be wrapped with Parser.htmlToText() for consistency and to prevent HTML from appearing in search results.
|
@Pujan92 What do you think about these suggest fixes? |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
trjExpensify
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that looked janky! 👍
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
Pujan92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Screen.Recording.2026-01-20.at.23.35.01.mov
lakchote
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.6-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.6-4 🚀
|
Explanation of Change
Fixed Issues
$ #78840
PROPOSAL: #78840 (comment)
Tests
Precondition: WS has 2 members
Offline tests
QA Steps
Precondition: WS has 2 members
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari