Skip to content
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 for payment 2024-01-24] [$500] Special characters not correctly escaped in system messages #33996

Closed
1 of 6 tasks
m-natarajan opened this issue Jan 5, 2024 · 15 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jan 5, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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

Recording.2641.mp4

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
@m-natarajan m-natarajan added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 5, 2024
@melvin-bot melvin-bot bot changed the title Special characters not correctly escaped in system messages [$500] Special characters not correctly escaped in system messages Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~0189452e8b1cef5839

Copy link

melvin-bot bot commented Jan 5, 2024

Triggered auto assignment to @NicMendonca (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Jan 5, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External)

@tienifr
Copy link
Contributor

tienifr commented Jan 5, 2024

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)

<Text style={[styles.chatItemMessage, styles.colorMuted]}>{message}</Text>

or when getting marked reimburse message here (if we only want it for the marked reimburse message)
return reportAction?.message?.map((element) => element.text).join('') ?? '';

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 5, 2024
Copy link

melvin-bot bot commented Jan 5, 2024

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Jan 5, 2024

📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@roryabraham
Copy link
Contributor

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

@cubuspl42
Copy link
Contributor

Great, we're waiting for the PR 👍

@tienifr
Copy link
Contributor

tienifr commented Jan 8, 2024

PR ready for review #34081.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jan 17, 2024
@melvin-bot melvin-bot bot changed the title [$500] Special characters not correctly escaped in system messages [HOLD for payment 2024-01-24] [$500] Special characters not correctly escaped in system messages Jan 17, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 17, 2024
Copy link

melvin-bot bot commented Jan 17, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.25-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-01-24. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Jan 17, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
  • [@cubuspl42] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@cubuspl42] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@cubuspl42] Determine if we should create a regression test for this bug.
  • [@cubuspl42] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@NicMendonca] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
    • It seems that the bug was present in the relevant components since they were created
  • The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
    • N/A
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • No need for a regression test
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
    • N/A

@NicMendonca
Copy link
Contributor

@tienifr @cubuspl42 - you've both been paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants