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-03-13] Empty line appears both in report and in LHN if # is followed by two or more spaces in multiline message #15372

Closed
6 tasks
kavimuru opened this issue Feb 22, 2023 · 19 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 Engineering Improvement Item broken or needs improvement. Internal Requires API changes or must be handled by Expensify staff

Comments

@kavimuru
Copy link

kavimuru commented Feb 22, 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!


Action Performed:

  1. Go to any chat
  2. Send a message like
#  
The above # followed by two or more spaces will be translated to an empty line
  1. Notice '# ' in the first line is displayed as a line break instead of text '# ' and message preview in LHN is empty

Expected Result:

The first line of the message and message preview is LHN should be '# '

Actual Result:

The first line of the message is displayed as an empty line and message preview in LHN is empty as well

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.75-0
Reproducible in staging?: y
Reproducible in production?: y
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:

Screen.Recording.2023-02-22.at.8.59.05.PM.mov
Recording.1579.mp4

Expensify/Expensify Issue URL:
Issue reported by: @eh2077
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1677074059909059

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0179eff6125b6d2857
  • Upwork Job ID: 1628730351044272128
  • Last Price Increase: 2023-02-23
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 22, 2023
@MelvinBot
Copy link

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

@melvin-bot melvin-bot bot locked and limited conversation to collaborators Feb 22, 2023
@MelvinBot
Copy link

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

@Gonals Gonals self-assigned this Feb 23, 2023
@Gonals
Copy link
Contributor

Gonals commented Feb 23, 2023

Taking a look

@Gonals Gonals added Improvement Item broken or needs improvement. Engineering Internal Requires API changes or must be handled by Expensify staff labels Feb 23, 2023
@melvin-bot melvin-bot bot unlocked this conversation Feb 23, 2023
@MelvinBot
Copy link

Job added to Upwork: https://www.upwork.com/jobs/~0179eff6125b6d2857

@eh2077
Copy link
Contributor

eh2077 commented Feb 23, 2023

Proposal

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

The first line of a two line message, like

#  
The above # followed by two or more spaces will be translated to an empty HTML heading "<h1> </h1>"

will be displayed as an empty line and the message preview in LHN is empty.

What is the root cause of that problem?

The regex rule

https://github.com/Expensify/expensify-common/blob/a2942d035614bf4bed90ffe2114d6ee828ee96da/lib/ExpensiMark.js#L167-L168

to translate markdown heading to HTML heading matches the last spaces if there're two or more spaces after #

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

To fix this issue, we need to positive lookahead any non-whitespace character before the first capturing group. We can improve regex rule https://github.com/Expensify/expensify-common/blob/a2942d035614bf4bed90ffe2114d6ee828ee96da/lib/ExpensiMark.js#L167

from

/^#(?!#) +(.+)$\s*/gm

to

/^#(?!#) +(?=\S)(.+)$\s*/gm

What alternative solutions did you explore? (Optional)

None

@MelvinBot
Copy link

Triggered auto assignment to Contributor Plus for review of internal employee PR - @s77rt (Internal)

@Gonals
Copy link
Contributor

Gonals commented Feb 23, 2023

I don't think this one will require c+ review :)

@MelvinBot
Copy link

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

@NicMendonca
Copy link
Contributor

@Gonals just to confirm - what's the latest on this 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 Mar 6, 2023
@melvin-bot melvin-bot bot changed the title Empty line appears both in report and in LHN if # is followed by two or more spaces in multiline message [HOLD for payment 2023-03-13] Empty line appears both in report and in LHN if # is followed by two or more spaces in multiline message Mar 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 6, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.78-0 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-03-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

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

@MelvinBot
Copy link

MelvinBot commented Mar 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:

@NicMendonca
Copy link
Contributor

@eh2077 don't forget to apply tot he job for reporting

@eh2077
Copy link
Contributor

eh2077 commented Mar 11, 2023

Hi @NicMendonca , thanks for reminding! But it looks like I can’t access the job on Upwork

image

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 12, 2023
@NicMendonca
Copy link
Contributor

Opps, sorry! I've made it public. @eh2077 can you try again please?

@eh2077
Copy link
Contributor

eh2077 commented Mar 14, 2023

@NicMendonca I have applied the job, thank you!

@NicMendonca
Copy link
Contributor

@eh2077 paid! 🎉

@eh2077
Copy link
Contributor

eh2077 commented Mar 15, 2023

Hi @NicMendonca , I just accepted the offer you sent me!

Hmm, it looks like still need your help to make the payment and then end the contract on Upwork. Would you please help with it? Thanks!

@NicMendonca
Copy link
Contributor

@eh2077 sorry! Just re-issued payment and closed out the contract. Can you confirm on your end?

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 Engineering Improvement Item broken or needs improvement. Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

No branches or pull requests

6 participants