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 2024-10-22] [$125.00] The finder page display last message text is different from LHN #50145

Closed
6 tasks done
m-natarajan opened this issue Oct 3, 2024 · 20 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

@m-natarajan
Copy link

m-natarajan commented Oct 3, 2024

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.44-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
Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1727421902555249

Action Performed:

  1. Open any report
  2. Send a message with h1 tag and image tag. i.e. # Business? Personal? Now it's both. Are you here to track business expenses or personal spend? Or maybe both? Expensify lets you track it all together on a chat-based platform. Collaborate with colleagues, friends, or your accountant, and keep all your financial management needs in one app! [Try it now](https://new.expensify.com/track-expense) and see for yourself. ![1707757682096-1_ChatDM_v2_10fps_600w_256color.gif](https://s3-us-west-1.amazonaws.com/concierge-responses-expensify-com/uploads/1707757682096-1_ChatDM_v2_10fps_600w_256color.gif)
  3. Notice the last message text in LHN
  4. Click on the search icon in the top bar
  5. Notice the last message text of the report in step 1

Expected Result:

In the finder page, the last message text should be the same that is displayed in LHN

Actual Result:

In the finder page, the last message text contains the HTML tag.

Workaround:

unknown

Platforms:

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

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

Screenshots/Videos

Screen.Recording.2024-09-27.at.14.20.28.mov
Screen.Recording.2024-09-27.at.14.20.28.mov

Snip - (25) New Expensify - Google Chrome (2)

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021842318129015789184
  • Upwork Job ID: 1842318129015789184
  • Last Price Increase: 2024-10-04
  • Automatic offers:
    • dukenv0307 | Reviewer | 104302118
    • nkdengineer | Contributor | 104302120
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @adelekennedy
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

Triggered auto assignment to @adelekennedy (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.

@nkdengineer
Copy link
Contributor

Proposal

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

The last message text in the finder page contains the HTML tag

What is the root cause of that problem?

When we send the message like the step, lastMessageText of the report contains HTML tag and we don't convert it to text here that cause the bug happens in the finder page

function getAlternateText(option: ReportUtils.OptionData, {showChatPreviewLine = false, forcePolicyNamePreview = false}: PreviewConfig) {
const report = ReportUtils.getReportOrDraftReport(option.reportID);
const isAdminRoom = ReportUtils.isAdminRoom(report);
const isAnnounceRoom = ReportUtils.isAnnounceRoom(report);
const isGroupChat = ReportUtils.isGroupChat(report);
const isExpenseThread = ReportUtils.isMoneyRequest(report);
if (isExpenseThread || option.isMoneyRequestReport) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'iou.expense');
}
if (option.isThread) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'threads.thread');
}
if (option.isChatRoom && !isAdminRoom && !isAnnounceRoom) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : option.subtitle;
}
if ((option.isPolicyExpenseChat ?? false) || isAdminRoom || isAnnounceRoom) {
return showChatPreviewLine && !forcePolicyNamePreview && option.lastMessageText ? option.lastMessageText : option.subtitle;
}
if (option.isTaskReport) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'task.task');
}
if (isGroupChat) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'common.group');
}
return showChatPreviewLine && option.lastMessageText
? option.lastMessageText
: LocalePhoneNumber.formatPhoneNumber(option.participantsList && option.participantsList.length > 0 ? option.participantsList.at(0)?.login ?? '' : '');
}

This doesn't happen in LHN because we've used htmlToText here and here

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

We should create a new variable that is the converted message of the option. lastMessageText by using the same approach that we used in SidebarUtils. Then we can use this variable to replace the option. lastMessageText.

const formattedLastMessageText = ReportUtils.formatReportLastMessageText(Parser.htmlToText(option.lastMessageText ?? ''));

function getAlternateText(option: ReportUtils.OptionData, {showChatPreviewLine = false, forcePolicyNamePreview = false}: PreviewConfig) {
const report = ReportUtils.getReportOrDraftReport(option.reportID);
const isAdminRoom = ReportUtils.isAdminRoom(report);
const isAnnounceRoom = ReportUtils.isAnnounceRoom(report);
const isGroupChat = ReportUtils.isGroupChat(report);
const isExpenseThread = ReportUtils.isMoneyRequest(report);
if (isExpenseThread || option.isMoneyRequestReport) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'iou.expense');
}
if (option.isThread) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'threads.thread');
}
if (option.isChatRoom && !isAdminRoom && !isAnnounceRoom) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : option.subtitle;
}
if ((option.isPolicyExpenseChat ?? false) || isAdminRoom || isAnnounceRoom) {
return showChatPreviewLine && !forcePolicyNamePreview && option.lastMessageText ? option.lastMessageText : option.subtitle;
}
if (option.isTaskReport) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'task.task');
}
if (isGroupChat) {
return showChatPreviewLine && option.lastMessageText ? option.lastMessageText : Localize.translate(preferredLocale, 'common.group');
}
return showChatPreviewLine && option.lastMessageText
? option.lastMessageText
: LocalePhoneNumber.formatPhoneNumber(option.participantsList && option.participantsList.length > 0 ? option.participantsList.at(0)?.login ?? '' : '');
}

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

@adelekennedy I report this bug so I can help take it as C+. Thanks

@adelekennedy
Copy link

I can replicate but again, more of a polish here so reducing the price

@adelekennedy adelekennedy added the External Added to denote the issue can be worked on by a contributor label Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

@melvin-bot melvin-bot bot changed the title The finder page display last message text is different from LHN [$250] The finder page display last message text is different from LHN Oct 4, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 4, 2024
Copy link

melvin-bot bot commented Oct 4, 2024

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

@adelekennedy adelekennedy changed the title [$250] The finder page display last message text is different from LHN [$62.50] The finder page display last message text is different from LHN Oct 4, 2024
@melvin-bot melvin-bot bot added the Overdue label Oct 7, 2024
@dukenv0307
Copy link
Contributor

@nkdengineer's proposal LGTM

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 7, 2024

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

@MarioExpensify
Copy link
Contributor

@nkdengineer proposal looks good. Thank you @dukenv0307, let's move forward.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 7, 2024
Copy link

melvin-bot bot commented Oct 7, 2024

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Oct 7, 2024

📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer 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 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 Weekly KSv2 labels Oct 8, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Oct 15, 2024
@melvin-bot melvin-bot bot changed the title [$62.50] The finder page display last message text is different from LHN [HOLD for payment 2024-10-22] [$62.50] The finder page display last message text is different from LHN Oct 15, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 15, 2024
Copy link

melvin-bot bot commented Oct 15, 2024

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

Copy link

melvin-bot bot commented Oct 15, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.48-2 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 2024-10-22. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Oct 15, 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:

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

@nkdengineer
Copy link
Contributor

@adelekennedy Can you please update the price to 125 since the PR isn't a simple one-line change

@adelekennedy adelekennedy changed the title [HOLD for payment 2024-10-22] [$62.50] The finder page display last message text is different from LHN [HOLD for payment 2024-10-22] [$125.00] The finder page display last message text is different from LHN Oct 15, 2024
@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 21, 2024
@adelekennedy
Copy link

adelekennedy commented Oct 23, 2024

Payouts due:

Upwork job is here.

@tgolen
Copy link
Contributor

tgolen commented Oct 23, 2024

Reopening for @dukenv0307 and @adelekennedy to complete the regression checklist

@tgolen tgolen reopened this Oct 23, 2024
@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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
  • 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
  • Determine if we should create a regression test for this bug. Yes
  • 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.

Regression test:

  1. Open any report
  2. Send a message with h1 tag and image tag. i.e. # Business? Personal? Now it's both. Are you here to track business expenses or personal spend? Or maybe both? Expensify lets you track it all together on a chat-based platform. Collaborate with colleagues, friends, or your accountant, and keep all your financial management needs in one app! [Try it now](https://new.expensify.com/track-expense) and see for yourself. ![1707757682096-1_ChatDM_v2_10fps_600w_256color.gif](https://s3-us-west-1.amazonaws.com/concierge-responses-expensify-com/uploads/1707757682096-1_ChatDM_v2_10fps_600w_256color.gif)
  3. Notice the last message text in LHN
  4. Click on the search icon in the top bar
  5. Notice the last message text of the report in step 2
  6. Verify that: In the finder page, the last message text should be the same that is displayed in LHN

Do we 👍 or 👎

@dukenv0307
Copy link
Contributor

@adelekennedy I completed the checklists

@adelekennedy
Copy link

QA issue created!

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

6 participants