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] Room - Description field is empty when there is only one line description #48050

Closed
6 tasks done
IuliiaHerets opened this issue Aug 27, 2024 · 28 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

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: 9.0.25-0
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh050806@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to a room.
  3. Click on the room header.
  4. Click Description.
  5. Add a single line description and save it.

Expected Result:

Description field will show the room description.

Actual Result:

Description field is empty when there is only one line description.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6583715_1724719134103.line.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

Triggered auto assignment to @cristipaval (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Aug 27, 2024

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Daily KSv2 label Aug 27, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 27, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@nkdengineer
Copy link
Contributor

nkdengineer commented Aug 27, 2024

Edited by proposal-police: This proposal was edited at 2024-08-27 06:54:02 UTC.

Proposal

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

Description field is empty when there is only one line description.

What is the root cause of that problem?

We pass shouldTruncateTitle as true for the description item. Then it will call truncateHTML here

shouldTruncateTitle

In this function, we have a while loop that will execute if matches is not undefined and then we will get the truncatedContent in this loop. The problem here is if the room description doesn't have any HTML tag, matches is undefined then the loop doesn't execute that makes this function return an empty string.

https://github.com/Expensify/expensify-common/blob/d11466167bc562447d2dfdad624145040153efae/lib/ExpensiMark.ts#L1361

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

We can add comment tag when we call truncateHTML then the regex can always match the first time

if (shouldTruncateTitle) {
    titleToWrap = Parser.truncateHTML(`<comment>${titleToWrap}</comment>`, characterLimit, {ellipsis: '...'});
    return titleToWrap;
}

return titleToWrap ? `<comment>${titleToWrap}</comment>` : '';

if (shouldTruncateTitle) {
titleToWrap = Parser.truncateHTML(titleToWrap, characterLimit, {ellipsis: '...'});
}

What alternative solutions did you explore? (Optional)

@cristipaval
Copy link
Contributor

@nkdengineer could you also find the offending PR?

@nkdengineer
Copy link
Contributor

@cristipaval This comes from this PR.

@shubham1206agra
Copy link
Contributor

@nkdengineer Your RCA is correct. But the solution can be corrected from the App side without changing the actual truncate logic.

@nkdengineer
Copy link
Contributor

if (shouldTruncateTitle && title !== Parser.htmlToText(title)) {
    titleToWrap = Parser.truncateHTML(titleToWrap, characterLimit, {ellipsis: '...'});
}

@shubham1206agra What do you think if we prevent calling truncateHTML if the title doesn't contain html tag.

@puneetlath
Copy link
Contributor

@nkdengineer how about we wrap it in <comment> tags when passing to truncateHTML? Would you be able to raise a PR?

@nkdengineer
Copy link
Contributor

@puneetlath Yes I can raise a PR now.

@nkdengineer
Copy link
Contributor

Yeah I think that also is an option.

@nkdengineer
Copy link
Contributor

@nkdengineer how about we wrap it in tags when passing to truncateHTML? Would you be able to raise a PR?

@puneetlath Confirmed, this is also a work solution.

@nkdengineer
Copy link
Contributor

@shubham1206agra Updated proposal.

@puneetlath
Copy link
Contributor

Ok please raise a PR now.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Aug 27, 2024
@nkdengineer
Copy link
Contributor

@puneetlath The PR is ready.

@puneetlath
Copy link
Contributor

I confirmed this is fixed on staging. Demoting.

@puneetlath puneetlath removed the DeployBlockerCash This issue or pull request should block deployment label Aug 27, 2024
@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Sep 19, 2024
Copy link

melvin-bot bot commented Sep 19, 2024

This issue has not been updated in over 15 days. @abekkala, @cristipaval, @nkdengineer eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@abekkala
Copy link
Contributor

@puneetlath are you able to confirm if this is an issue of the automation failing or has this one really not been deployed to prod yet?

@puneetlath
Copy link
Contributor

This one should be on production as of a couple weeks ago. Right @nkdengineer?

@nkdengineer
Copy link
Contributor

@puneetlath Yes.

@abekkala
Copy link
Contributor

PAYMENT SUMMARY:

@abekkala abekkala changed the title Room - Description field is empty when there is only one line description [HOLD for Payment] Room - Description field is empty when there is only one line description Sep 20, 2024
@abekkala
Copy link
Contributor

Offers are still pending.
@nkdengineer, @shubham1206agra, if you can accept the offers in Upwork, I can get those paid out to you!

@shubham1206agra
Copy link
Contributor

@abekkala Offer accepted

@abekkala
Copy link
Contributor

@shubham1206agra payment sent and contract ended - thank you! 🎉

@abekkala
Copy link
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:

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

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Sep 23, 2024

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:

@nkdengineer
Copy link
Contributor

if you can accept the offers in Upwork, I can get those paid out to you!

@abekkala Offer accepted too, ty

@abekkala
Copy link
Contributor

@nkdengineer payment sent and contract ended - thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants