App: [HOLD for payment 2024-01-24] [$500] Special characters not correctly escaped in system messages

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.22-0 Reproducible in staging?: yes Reproducible in production?: yes 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 Expensify/Expensify Issue URL: Issue reported by: @roryabraham Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1704393581910299

Action Performed:

  1. In OldDot, create Collect plan, set as default
  2. Set isPolicyExpenseChatEnabled = “true” on the policy by:
    1. Opening the policy settings in OldDot
    2. Open the JS console and run the following commands
    3. p = Policy.getCurrent();
    4. p.policy.isPolicyExpenseChatEnabled = "true";
    5. p.save();
  3. In OldDot, create report on ^ policy & add an expense
  4. In OldDot, submit the report (to yourself) & approve it
  5. Open the report in NewDot, in another tab or device. Make sure that you have the expense report open and the reportID in the url matches. Make sure you can see both OldDot and NewDot at the same time.
  6. In OldDot, mark the report as reimbursed (Reimburse -> I’ll do it manually). Important: Leave a message when you’re reimbursing the report saying “I’m manually reimbursing this report”

Expected Result:

In the NewDot tab, you should immediately see the new report action text, which should be You marked this report as manually reimbursed, saying "I'm marking this as manually reimbursed for testing". This report will be reimbursed outside of Expensify

Actual Result:

In the NewDot tab, you immediately see the new report action text, but it says: You marked this report as manually reimbursed. This report will be reimbursed outside of Expensify, saying I'm marking this as manually reimbursed for testing

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/38435837/92119e81-cc36-4588-8ff8-9d124df4af1c

image (13)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0189452e8b1cef5839
  • Upwork Job ID: 1743086166231134208
  • Last Price Increase: 2024-01-05
  • Automatic offers:
    • cubuspl42 | Reviewer | 28082747
    • tienifr | Contributor | 28082748

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@tienifr LGTM, let’s apply it in ReportActionItemBasicMessage.tsx as you’ve suggested

Proposal

Please re-state the problem that we are trying to solve in this issue.

In the NewDot tab, you immediately see the new report action text, but it says: You marked this report as manually reimbursed. This report will be reimbursed outside of Expensify, saying I'm marking this as manually reimbursed for testing

What is the root cause of that problem?

The system message from back-end is html-encoded, but we’re not htmlDecode the system message in front-end side, so it still shows as is in front-end.

What changes do you think we should make in order to solve the problem?

htmlDecode the system message in front-end side.

There’s the Str.htmlDecode already made for it.

We can do that for example inside here (so it applies to all basic message) https://github.com/Expensify/App/blob/095161a690e0cea4cf5352b3d03212530a364fea/src/pages/home/report/ReportActionItemBasicMessage.tsx#L15 or when getting marked reimburse message here (if we only want it for the marked reimburse message) https://github.com/Expensify/App/blob/095161a690e0cea4cf5352b3d03212530a364fea/src/libs/ReportActionsUtils.ts#L775

What alternative solutions did you explore? (Optional)

NA