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-08-07] [$1000] Chat - Extra line breaks added when pasting text from code editor #22890

Closed
1 of 6 tasks
lanitochka17 opened this issue Jul 14, 2023 · 37 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

@lanitochka17
Copy link

lanitochka17 commented Jul 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. Navigate to staging.new.expensify.com
  2. Copy the text from code editor:
    if (files.length > 0) {
    // Prevent the default so we do not post the file name into the text box
    event.preventDefault();
    this.props.onPasteFile(event.clipboardData.files[0]);
    return;
  3. Paste the text in the compose box of a conversation in New Expensify

Expected Result:

Pasted text should be correctly displayed with the expected line breaks in the compose box

Actual Result:

Pasted text should be correctly displayed - extra line breaks added when pasting text from code editor

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.40.5

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6127859_Recording__365.1.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b57bc0495e0f6542
  • Upwork Job ID: 1683569394738528256
  • 2023-07-24
  • Automatic offers:
    • | | 0
    • s-alves10 | Contributor | 25757442
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 14, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 14, 2023

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

@melvin-bot
Copy link

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

@s-alves10
Copy link
Contributor

s-alves10 commented Jul 14, 2023

Proposal

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

Extra line breaks added when pasting text from code editor on windows

What is the root cause of that problem?

End of line(EOL) is represented differently on various platforms. On Unix-like systems including Mac OS, \n is the code for EOL, and \r\n is the code for EOL on Windows.
We are using \n in the ExpensiMark now. When addComment API is called, we replace markdown with html elements and below rule is applied.

const commentText = getParsedComment(text);

So EOL(\r\n on Windows) is converted to \r<br /> and \n<br /> is returned from the backend.

This is the root cause

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

We need to handle \r\n or \n as EOL in parsing markdown

The current newline rule is as follows

            {
                name: 'newline',
                regex: /\n/g,
                replacement: '<br />',
            },

Replace this with

            {
                name: 'newline',
                regex: /\r?\n/g,
                replacement: '<br />',
            },

This works as expected.

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

@anmurali Whoops! This issue is 2 days overdue. Let's get this updated quick!

@anmurali
Copy link

Cannot reproduce

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@s-alves10
Copy link
Contributor

@anmurali
I'm not sure why this issue was closed. This is still reproducible on staging

22890.mp4

@kbecciv
Copy link

kbecciv commented Jul 20, 2023

QA team is reproduced on build 1.3.43.1

singlelinebrk.mp4

@kbecciv kbecciv reopened this Jul 20, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 24, 2023
@anmurali anmurali removed their assignment Jul 24, 2023
@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@anmurali anmurali added Overdue Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 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

@slafortune
Copy link
Contributor

Thanks for the reproduction!

@melvin-bot melvin-bot bot removed the Overdue label Jul 24, 2023
@slafortune slafortune added the External Added to denote the issue can be worked on by a contributor label Jul 24, 2023
@melvin-bot melvin-bot bot changed the title Chat - Extra line breaks added when pasting text from code editor [$1000] Chat - Extra line breaks added when pasting text from code editor Jul 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 24, 2023

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

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

melvin-bot bot commented Jul 24, 2023

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Jul 26, 2023
@s-alves10
Copy link
Contributor

@rushatgabhane

PR is ready for review

@rushatgabhane
Copy link
Member

yayy, we merged everything in 24 hrs

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 31, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Chat - Extra line breaks added when pasting text from code editor [HOLD for payment 2023-08-07] [$1000] Chat - Extra line breaks added when pasting text from code editor Jul 31, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 31, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 31, 2023

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

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:

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 Jul 31, 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:

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

@rushatgabhane
Copy link
Member

  1. The PR that introduced the bug has been identified. Link to the PR: N.A. This bug was always present and won't happen again because of the unit tests in expensify-common.

  2. 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.

  3. 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: N.A.

  4. Determine if we should create a regression test for this bug. No

  5. 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.

@rushatgabhane
Copy link
Member

Created a manual request - https://staging.new.expensify.com/r/7966456959101740

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Aug 6, 2023
@Julesssss
Copy link
Contributor

Can we complete the checklists? Is that the only blocker here?

@melvin-bot melvin-bot bot removed the Overdue label Aug 7, 2023
@JmillsExpensify
Copy link

@slafortune Mind summarizing the appropriate payouts for everyone?

@melvin-bot melvin-bot bot added the Overdue label Aug 9, 2023
@JmillsExpensify
Copy link

@slafortune Friendly bump on the payment summary.

@rushatgabhane
Copy link
Member

I think this qualifies for a bonus - #22890 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Aug 10, 2023
@slafortune
Copy link
Contributor

Shoot! Sorry all, not sure how I've missed this!

  • External issue reporter - Applause, no payment needed
  • Contributor that fixed the issue - @s-alves10 - $1500 with speed bonus - PD via Upworks
  • Contributor+ that helped on the issue and/or PR - @rushatgabhane - $1500 with speed bonus - Eligable for Manual Requests

@melvin-bot melvin-bot bot added the Overdue label Aug 14, 2023
@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2023
@JmillsExpensify
Copy link

Reviewed the details for @rushatgabhane. Approved for payment in NewDot based on the above BZ summary.

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

8 participants