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-07-06] [$1000] Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode) #20783

Closed
6 tasks done
kbecciv opened this issue Jun 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 Jun 14, 2023

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:

  1. Open the app
  2. Open any custom workspace room or create new by: click on plus->new room->any name, any workspace, any visibility->create room
  3. Click on room name to open details page
  4. Click on settings
  5. Click on welcome message
  6. Add any HTML code eg: 0 and click on save
  7. Revisit welcome message to see that it still displays HTML code
  8. turn off internet to go offline and revisit welcome message to see that on HTML code is converted to HTML character (In our eg, 0 will display as 0)

Expected Result:

App should not convert HTML code to HTML character in room welcome message

Actual Result:

In offline mode, app converts HTML code to HTML character in room welcome message

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.2.27.6

Reproducible in staging?: yes

Reproducible in production?: n/a

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

app.converts.html.code.to.character.welcome.message.1.mp4
Recording.722.1.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686214026251619

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01187aec34f1d4c1eb
  • Upwork Job ID: 1669149753584140288
  • Last Price Increase: 2023-06-15
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 14, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 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

@dukenv0307
Copy link
Contributor

Proposal

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

Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode)

What is the root cause of that problem?

In offline mode props.report.welcomeMessage is welcomeMessage that is updated in optimisticData and it is updated to newValue instead of parsedWelcomeMessage

value: {welcomeMessage: newValue},

and then in ReportWelcomeMessagePage, it is converted to character by parser.htmlToMarkdown(props.report.welcomeMessage)
const [welcomeMessage, setWelcomeMessage] = useState(parser.htmlToMarkdown(props.report.welcomeMessage));

While we pass welcomeMessage in the payload of API is parsedWelcomeMessage and after API return data props.report.welcomeMessage now is updated to parsedWelcomeMessage so that this issue doesn't occur in online mode
API.write('UpdateWelcomeMessage', {reportID, welcomeMessage: parsedWelcomeMessage}, {optimisticData, failureData});

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

We should update welcomeMessage in optimisticData to parsedWelcomeMessage instead of newValue.

What alternative solutions did you explore? (Optional)

@lschurr lschurr added the External Added to denote the issue can be worked on by a contributor label Jun 15, 2023
@melvin-bot melvin-bot bot changed the title Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode) [$1000] Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode) Jun 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01187aec34f1d4c1eb

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

Current assignee @lschurr is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

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

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

melvin-bot bot commented Jun 15, 2023

Triggered auto assignment to @techievivek (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Victor-Nyagudi
Copy link
Contributor

I think this could be related to this other issue when using HTML character codes in the workspace name.

@univalchemist
Copy link

univalchemist commented Jun 15, 2023

Proposal

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

Welcome message of workspace room translates HTML code to character in offline mode(It works fine in online mode)

What is the root cause of that problem?

The decode function of this package decodes as 0 in case of wrong code entity like 0

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

htmlToMarkdown function of expensify-common/lib/ExpensiMark lib should be updated by adding the following condition

        const replacedElement = this.replaceBlockElementWithNewLine(generatedMarkdown)
        const decodedHtml = Str.htmlDecode(replacedElement)
        if (decodedHtml && decodedHtml !== '0') return decodedHtml;

        return replacedElement;

The original codebase is

return Str.htmlDecode(this.replaceBlockElementWithNewLine(generatedMarkdown));

What alternative solutions did you explore? (Optional)

If this expensify common lib should not be changed, the changes should be in setting the initial value of welcomeMessageof component itself src/pages/ReportWelcomeMessagePage.js

    const parsedMarkdown = parser.htmlToMarkdown(props.report.welcomeMessage)
    const [welcomeMessage, setWelcomeMessage] = useState(parsedMarkdown && parsedMarkdown !== 0 ? parsedMarkdown : props.report.welcomeMessage);

https://www.loom.com/share/2010b567a16f42e38b87a2779d1580a4

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

📣 @univalchemist! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@univalchemist
Copy link

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/jaysondave

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@univalchemist
Copy link

Added video in proposal

@melvin-bot melvin-bot bot added the Overdue label Jun 19, 2023
@techievivek
Copy link
Contributor

Bumping @0xmiroslav to have a look at the above proposals.

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Jun 19, 2023
@lschurr
Copy link
Contributor

lschurr commented Jun 21, 2023

Hi @0xmiroslav - looks like we're still waiting for your review.

@melvin-bot melvin-bot bot removed the Overdue label Jun 21, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Jun 21, 2023

I am inclined to @dukenv0307's root cause and solution.
I will test myself and finally approve tomorrow.

@0xmiros
Copy link
Contributor

0xmiros commented Jun 22, 2023

@dukenv0307's proposal looks good to me.
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Jun 22, 2023

Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Beamanator
Copy link
Contributor

@techievivek I'm unassigning myself b/c you were assigned here first (I think i got assigned because of the new process - C+ approving proposals)

@Beamanator Beamanator removed their assignment Jun 23, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

📣 @dukenv0307 You have been assigned to this job by @techievivek!
Please apply to this job in Upwork 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 📖

@dukenv0307
Copy link
Contributor

@0xmiroslav Hi, The PR is ready for review

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Overdue labels Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 28, 2023

🎯 ⚡️ Woah @0xmiroslav / @dukenv0307, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dukenv0307 got assigned: 2023-06-26 04:26:12 Z
  • when the PR got merged: 2023-06-28 05:16:35 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jun 29, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode) [HOLD for payment 2023-07-06] [$1000] Welcome message of custom workspace room translates HTML code to character in offline mode (works fine in online mode) Jun 29, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.34-1 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-07-06. 🎊

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jun 29, 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@lschurr
Copy link
Contributor

lschurr commented Jul 5, 2023

@dukenv0307 @0xmiroslav - could you apply for the job in Upwork? https://www.upwork.com/jobs/~01187aec34f1d4c1eb

@lschurr
Copy link
Contributor

lschurr commented Jul 5, 2023

Also @0xmiroslav do we need a regression test for this one?

@lschurr
Copy link
Contributor

lschurr commented Jul 5, 2023

@dhanashree-sawant could you also apply for the job in Upwork for the reporting bonus?

@0xmiros
Copy link
Contributor

0xmiros commented Jul 5, 2023

I don't think regression test is needed. This issue itself is edge case.

@dhanashree-sawant
Copy link

Thanks @lschurr, if possible, can you invite me to the job?

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 5, 2023
@lschurr
Copy link
Contributor

lschurr commented Jul 6, 2023

@dhanashree-sawant could you include your Upwork profile here so that I can invite you to the job?

@dhanashree-sawant
Copy link

Hi @lschurr, Thanks.
My profile link: https://www.upwork.com/freelancers/~016c7b8ae165dc0bda

@lschurr
Copy link
Contributor

lschurr commented Jul 6, 2023

All paid and closed :)

@lschurr lschurr closed this as completed Jul 6, 2023
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

9 participants