-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD #19218] [$1000] The new description on the report displays <
for <
#19386
Comments
Triggered auto assignment to @puneetlath ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPosting proposal early as per new guidelines Please re-state the problem that we are trying to solve in this issue.The new description on the report displays < for < What is the root cause of that problem?Description render via this code App/src/components/MoneyRequestHeader.js Lines 184 to 187 in d7cbeca
At line 186 we are not using htmlDecode while display transaction description. This is the root cause of the problem. What changes do you think we should make in order to solve the problem?We have to use <MenuItemWithTopDescription
description={props.translate('common.description')}
//title={transactionDescription} // ** OLD
title={Str.htmlDecode(transactionDescription)} // **** Updated Code
/> This will solve the issue as shown in result. What alternative solutions did you explore? (Optional)None |
ProposalPlease re-state the problem that we are trying to solve in this issue.The new description on the report displays < for < What is the root cause of that problem?Currently, the When we show this App/src/components/MoneyRequestHeader.js Line 186 in d7cbeca
So it shows raw data with html encoded format. What changes do you think we should make in order to solve the problem?In IOUPreview, we also use same util Line 987 in d7cbeca
|
<
for <
<
for <
Job added to Upwork: https://www.upwork.com/jobs/~018a6bdbdd645dde11 |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @fedirjh ( |
Current assignee @puneetlath is eligible for the External assigner, not assigning anyone new. |
ProposalPosting proposal early as per new guidelines Please re-state the problem that we are trying to solve in this issue.The new description on the report displays < for < What is the root cause of that problem?Description rendered in the file App/src/components/MoneyRequestHeader.js at line <>
<MenuItemWithTopDescription
title={formattedTransactionAmount}
description={`${props.translate('iou.amount')} • ${props.translate('iou.cash')}`}
titleStyle={styles.newKansasLarge}
/>
<MenuItemWithTopDescription
description={props.translate('common.description')}
title={transactionDescription}
/>
<MenuItemWithTopDescription
description={props.translate('common.date')}
title={formattedTransactionDate}
/>
</> What changes do you think we should make in order to solve the problem?
<MenuItemWithTopDescription
description={props.translate('common.description')}
title={Str.htmlDecode(transactionDescription)}
/> What alternative solutions did you explore? (Optional)There is another common that can updated to resolve the issue: In the file // const requestComment = Str.htmlDecode(moneyRequestAction.comment).trim(); /** Old code **/
const requestComment = moneyRequestAction.comment; /** updated code **/ Implemented html entities decoding in Here is updated code: **
* We get the amount, currency and comment money request value from the action.originalMessage.
* But for the send money action, the above value is put in the IOUDetails object.
*
* @param {Object} reportAction
* @param {Number} reportAction.amount
* @param {String} reportAction.currency
* @param {String} reportAction.comment
* @param {Object} [reportAction.IOUDetails]
* @returns {Object}
*/
function getMoneyRequestAction(reportAction = {}) {
const originalMessage = lodashGet(reportAction, 'originalMessage', {});
let amount = originalMessage.amount || 0;
let currency = originalMessage.currency || CONST.CURRENCY.USD;
let comment = Str.htmlDecode(originalMessage.comment.trim()) || ''; // Added html decode here
if (_.has(originalMessage, 'IOUDetails')) {
amount = lodashGet(originalMessage, 'IOUDetails.amount', 0);
currency = lodashGet(originalMessage, 'IOUDetails.currency', CONST.CURRENCY.USD);
comment = lodashGet(originalMessage, 'IOUDetails.comment', '');
}
return {amount, currency, comment};
} Contributor details |
📣 @spcheema! 📣
|
Reviewing today |
Thanks to everyone for the proposals. The RCA (Root Cause Analysis) clearly indicates that we are not decoding the HTML-encoded string. I think the appropriate approach we should follow is to fix the Based on what has been said, I believe we should proceed with this proposal by @hoangzinh cc @puneetlath 🎀 👀 🎀 C+ reviewed |
@spcheema Thanks for the proposal , but it is a duplicate from @hoangzinh proposal |
Thanks for review @fedirjh |
@fedirjh I think this other issue where using backticks in the send/request money description changes them to A pull request is also currently being worked on/reviewed that might fix this issue. What are your thoughts on this? cc: @puneetlath |
Thanks @Victor-Nyagudi for great catch . Cc @mollfpr could you please verify if this case will be fixed by this pr #19218 ? |
@fedirjh Ahh, yes! We will send the text as is without parsing it to markdown. |
@puneetlath Let's hold it for #19218 |
<
for <
<
for <
<
for <
<
for <
Still on hold. |
@puneetlath It looks to be fixed, PR was deployed to prod , I think we can close this issue ![]() |
Makes sense. Thanks everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
The new description on the report should not display < for < as how it is done in the money report
Actual Result:
The new description on the report displays < for < (works well with money report)
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.16-6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
error-2023-05-19_11.04.53.mp4
Recording.715.mp4
Expensify/Expensify Issue URL:
Issue reported by: @avi-shek-jha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684473836089219
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: