Skip to content

[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

Description

@kavimuru

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

Activity

  1. added
    Daily
    Bug
    on Feb 22, 2023
  2. MelvinBot commented on Feb 22, 2023

    @MelvinBot
    Contributor

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

  3. locked and limited conversation to collaborators on Feb 22, 2023
  4. MelvinBot commented on Feb 22, 2023

    @MelvinBot
    Contributor

    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
  5. self-assigned this
    on Feb 23, 2023
  6. Gonals commented on Feb 23, 2023

    @Gonals
    Contributor

    Taking a look

  7. added
    Improvement
    Internal
    on Feb 23, 2023
  8. unlocked this conversation on Feb 23, 2023
  9. MelvinBot commented on Feb 23, 2023

    @MelvinBot
    Contributor
  10. eh2077 commented on Feb 23, 2023

    @eh2077
    Contributor

    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

  11. 9 remaining items

  12. 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[/+] on Mar 6, 2023
  13. removed
    Reviewing
    on Mar 6, 2023
  14. MelvinBot commented on Mar 6, 2023

    @MelvinBot
    Contributor

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

  15. MelvinBot commented on Mar 6, 2023

    @MelvinBot
    Contributor

    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
  16. MelvinBot commented on Mar 6, 2023

    @MelvinBot
    Contributor

    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:

  17. NicMendonca commented on Mar 10, 2023

    @NicMendonca
    Contributor

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

  18. eh2077 commented on Mar 11, 2023

    @eh2077
    Contributor

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

    image

  19. added
    Daily
    and removed
    Weekly
    on Mar 12, 2023
  20. NicMendonca commented on Mar 13, 2023

    @NicMendonca
    Contributor

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

  21. eh2077 commented on Mar 14, 2023

    @eh2077
    Contributor

    @NicMendonca I have applied the job, thank you!

  22. NicMendonca commented on Mar 14, 2023

    @NicMendonca
    Contributor

    @eh2077 paid! 🎉

  23. eh2077 commented on Mar 15, 2023

    @eh2077
    Contributor

    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!

  24. NicMendonca commented on Mar 15, 2023

    @NicMendonca
    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

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringImprovementInternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions