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 2023-11-13] [$500] Room - Message starting with “<<“ not displayed in the welcome message #29612

Closed
5 of 6 tasks
kbecciv opened this issue Oct 14, 2023 · 36 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@kbecciv
Copy link

kbecciv commented Oct 14, 2023

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.3.84.0
Reproducible in staging?: y
Reproducible in production?: new feature
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: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697214320531079

Action Performed:

  1. Navigate to Send message > Room
  2. Enter a room name and enter a welcome message starting with “<<message”
  3. Select a workspace and create the room
  4. Go to the room detail page > Settings > Welcome message

Expected Result:

Message starting with “<<“ should be displayed in the welcome message

Actual Result:

Message starting with “<<“ not showing in the welcome message

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

Android: Native
crashed, not able to check
Android: mWeb Chrome
Screen_Recording_20231014_115905_Chrome.mp4
iOS: Native
Screen.Recording.2023-10-13.at.9.26.29.PM.mov
iOS: mWeb Safari
Screen.Recording.2023-10-13.at.9.32.01.PM.mov
MacOS: Chrome / Safari
2023-10-13.20-59-57.mp4
MacOS: Desktop
Screen.Recording.2023-10-13.at.11.38.01.PM.mov

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01aaeb78bffb57b09f
  • Upwork Job ID: 1713225046807224320
  • Last Price Increase: 2023-10-28
  • Automatic offers:
    • cubuspl42 | Reviewer | 27443023
    • abzokhattab | Contributor | 27443025
@kbecciv kbecciv 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 Oct 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

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

@melvin-bot melvin-bot bot changed the title Room - Message starting with “<<“ not displayed in the welcome message [$500] Room - Message starting with “<<“ not displayed in the welcome message Oct 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01aaeb78bffb57b09f

@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 14, 2023

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

@abzokhattab
Copy link
Contributor

abzokhattab commented Oct 14, 2023

Proposal

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

Message starting with “<<“ is not shown in the welcome message

What is the root cause of that problem?

The frontend displays the welcome message by converting it from html to markdown and the problem arises when creating a new room, special markdown characters, such as < in the welcome message field are not correctly escaped. This results in the frontend displaying an empty quotation.

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

in the create action we should parse the message before it is saved, like we do in the update wlcome message action

const parsedWelcomeMessage = ReportUtils.getParsedComment(newValue);

To parse the message when creating the room:

we need to add the prev line in the addPolicyReport function as well this way the create and update welcome message actions have the same same parsing process which ensures consistency.

const parsedWelcomeMessage = ReportUtils.getParsedComment(welcomeMessage);

and use it here:

const policyReport = ReportUtils.buildOptimisticChatReport(
  participants,
  reportName,
  CONST.REPORT.CHAT_TYPE.POLICY_ROOM,
  policyID,
  CONST.REPORT.OWNER_ACCOUNT_ID_FAKE,
  false,
  "",
  visibility,
  writeCapability,

  // The room might contain all policy members so notifying always should be opt-in only.
  CONST.REPORT.NOTIFICATION_PREFERENCE.DAILY,
  "",
  "",
  parsedWelcomeMessage
);

and finally in the api.write:

API.write(
  "AddWorkspaceRoom",
  {
    policyID: policyReport.policyID,
    reportName,
    visibility,
    reportID: policyReport.reportID,
    createdReportActionID: createdReportAction.reportActionID,
    writeCapability,
    welcomeMessage: parsedWelcomeMessage
  },
  { optimisticData, successData, failureData }
);

POC

Screen.Recording.2023-10-14.at.7.42.19.PM.mov

@AmjedNazzal
Copy link
Contributor

Proposal

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

Room - Message starting with “<<“ not displayed in the welcome message

What is the root cause of that problem?

The reason for this is that we are parsing the welcome message using htmlToMarkdown which doesn't accept "<>"

const [welcomeMessage, setWelcomeMessage] = useState(parser.htmlToMarkdown(props.report.welcomeMessage));

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

Instead of using parser.htmlToMarkdown we can use parser.htmlToText since the welcome message is just text or we can just use report.welcomeMessage as it is

Result

Screen.Recording.2023-10-14.at.8.04.49.PM.mov

@peterdbarkerUK
Copy link
Contributor

peterdbarkerUK commented Oct 16, 2023

Hmm, I couldn't reproduce this - where am I going wrong?

Edit: ugh I did add the wrong video, that'll teach me for working late. Good catch!

Here's the correct one:

WelcomeMEssageBug.mp4

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@abzokhattab
Copy link
Contributor

I think you attached a wrong video, Peter, Right?

@AmjedNazzal
Copy link
Contributor

@peterdbarkerUK Can you please tell us what you are getting on your end?

@ayazhussain79
Copy link
Contributor

@peterdbarkerUK could you please try again it is still reproducible

Steps:

  1. Navigate to Send message > Room
  2. Enter a room name and enter a welcome message starting with “<<message”
  3. Select a workspace and create the room
  4. Go to the room detail page > Settings > Welcome message

@melvin-bot melvin-bot bot added the Overdue label Oct 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

@cubuspl42, @peterdbarkerUK Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot
Copy link

melvin-bot bot commented Oct 21, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot
Copy link

melvin-bot bot commented Oct 24, 2023

@cubuspl42, @peterdbarkerUK 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@peterdbarkerUK
Copy link
Contributor

Apologies, I'd updated the video above but my comment here was not saved.

I'm now able to reproduce.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Oct 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 28, 2023

@cubuspl42 @peterdbarkerUK this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Oct 28, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@cubuspl42
Copy link
Contributor

In my opinion, the clearest solution was suggested by @abzokhattab. I verified that indeed there's an asymmetry between updating the welcome message and creating a room with a welcome message. Attacking the issue from this angle seems the most correct.

C+ reviewed 🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

📣 @abzokhattab 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 30, 2023

📣 @ayazhussain79 We're missing your Upwork ID to automatically send you an offer for the Reporter role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 30, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] Room - Message starting with “<<“ not displayed in the welcome message [HOLD for payment 2023-11-13] [$500] Room - Message starting with “<<“ not displayed in the welcome message Nov 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2023
Copy link

melvin-bot bot commented Nov 6, 2023

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

Copy link

melvin-bot bot commented Nov 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.95-9 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 2023-11-13. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

Copy link

melvin-bot bot commented Nov 6, 2023

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.
  • [@peterdbarkerUK] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 Daily KSv2 labels Nov 13, 2023
@peterdbarkerUK
Copy link
Contributor

@abzokhattab @ayazhussain79 could you accept the offer in Upwork?

Thanks!

@cubuspl42 - paid $500 for review.

@cubuspl42 I think this is an edge case that needn't be added to testrail, would you agree? Could you also complete the rest of the checklist?

@ayazhussain79
Copy link
Contributor

@peterdbarkerUK offer accepted, Thank you

@abzokhattab
Copy link
Contributor

Thank you @peterdbarkerUK .. I have just accepted the offer.. please notice that this issue was opened before announcement, and the PR was merged within three days thus it should be eligible for the bonus.

@peterdbarkerUK
Copy link
Contributor

@abzokhattab thanks!

As per Greg's post, PRs created after the announcement on October 25th would not be eligible for the urgency bonus. The PR for this issue was created on October 30th. Please let me know if I've misunderstood something, or if you disagree!

Payment summary:

Job closed, issue will close once @cubuspl42 and I have resolved the checklist

@abzokhattab
Copy link
Contributor

I thought it is based on the issue’s creation date not the PR creation date

Thanks

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
  • 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:
  • 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

@peterdbarkerUK
Copy link
Contributor

All good @abzokhattab I had to check it over as well!

@peterdbarkerUK
Copy link
Contributor

Thanks Jakub!

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants