Skip to content

[Due for payment 2025-11-03] [Due for payment 2025-10-27] [Due for payment 2025-10-22] [Due for payment 2025-10-06] [$250] Chat - Message sent is not shown correctly in LHN #60746

Description

@lanitochka17

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 1.32-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): Slottwo1555d@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open any chat
  3. Send the following message:
    ©   <div>test</div>
  4. Note the message in the LHN
  5. Go to workspace settings - workspace chat
  6. Send the following message:
    ©   <div>test</div>
  7. Navigate to LHN and note the chat displays
    ©
    test
  8. Tap on chat
  9. Navigate back to LHN

Expected Result:

LHN should show exactly the message sent (
©   <div>test</div>)

Actual Result:

On sending this message (©   <div>test</div>)- LHN is not showing the entire text as it is , it displays © test & if same message sent from settings via opened workspace chat, displays ©

test
and on revisit changes to © test.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6811030_1745441402894.Screenrecorder-2025-04-24-02-05-36-493.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021915821361423926706
  • Upwork Job ID: 1915821361423926706
  • Last Price Increase: 2025-06-06
  • Automatic offers:
    • QichenZhu | Reviewer | 108699905
Issue OwnerCurrent Issue Owner: @abekkala

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 23, 2025
  2. melvin-bot commented on Apr 23, 2025

    @melvin-bot

    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.

  3. bernhardoj commented on Apr 24, 2025

    @bernhardoj
    Contributor

    Proposal

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

    Message is not shown correctly on the LHN.

    What is the root cause of that problem?

    When we send an HTML to a chat, it will be converted to text.

    {Parser.htmlToText(optionItem.alternateText)}

    result.alternateText = formatReportLastMessageText(Parser.htmlToText(`${lastActorDisplayName}: ${lastMessageText}`));

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

    It was all added because of a BE bug where the lastMessageText contains HTML, even though it should only contain plain text. So to fix it, we patch it on the FE by converting the lastMessageText to text. But because of this, if the user sends HTML as a plain text, the LHN won't be able to show it.

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

    This is actually the same issue as #43563, and I suggest to removes the FE patch and properly fix it on the BE.

    If we can't fix the BE, still remove the patch, but instead of returning the lastMessageText, we can parse the lastMessageHtml to text.

    return lastMessageTextFromReport || (report?.lastMessageText ?? '');

    Parser.htmlToText(lastMessageHtml)

    This is at least semantically(?) correct, convert HTML to text. Previously, we converted a text that could contain HTML to text.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    I think we can test getLastMessageTextForReport, give it a dummy DM report with lastMessageHtml and assert the results is the converted HTML to text.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 25, 2025
  5. changed the title [-]Chat - Message sent is not shown correctly in LHN[/-] [+][$250] Chat - Message sent is not shown correctly in LHN[/+] on Apr 25, 2025
  6. melvin-bot commented on Apr 25, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 25, 2025
  8. melvin-bot commented on Apr 25, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @QichenZhu (External)

  9. melvin-bot commented on Apr 29, 2025

    @melvin-bot

    @QichenZhu Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  10. QichenZhu commented on Apr 29, 2025

    @QichenZhu
    Contributor

    @bernhardoj thanks for the proposal.

    About the first solution (fixing this in both FE and BE):

    • Can the BE tell whether the HTML was intentionally input by the user or generated from Markdown?
    • In addition to the BE issue mentioned in your proposal, when the user inputs &lt;, should lastMessageText be &lt; or <? It currently returns <:
    Image
  11. 125 remaining items

  12. abekkala commented on Oct 22, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR OCT 27

    • Fix: @bernhardoj [$250, if no regressions] payment via NewDot
    • PR Review @QichenZhu [$250, if no regressions] payment via Upwork - OFFER
      please complete checklist
  13. QichenZhu commented on Oct 27, 2025

    @QichenZhu
    Contributor

    BugZero Checklist:

    • [Contributor] 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: No offending PR in this repo.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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.

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue: https://github.com/Expensify/Expensify/issues/561655

    Regression Test Proposal

    Test:

    1. Open any chat
    2. Send a message with HTML tag (for example, <div>test</div>)
    3. Verify in LHN, the last message text shows the whole text

    Additional tests:

    A. Moved expense to self DM
    1. Create an expense in WS chat
    2. Open the expense and select the Report field
    3. Select Remove from report
    4. Open the expense in the self DM
    5. Verify the LHN's last message for the expense report has no HTML tag
    B. Failed to integrate accounting
    1. Enable accounting in WS
    2. Connect to anything that will fail
    3. Open the admins room
    4. Find the message that says the integration failed (it is sometimes inside a thread)
    5. Verify the report where the message appears. The LHN's last message has no HTML tag
    C. Move IOU report to workspace
    1. User A has a workspace and invites User B
    2. User B sends a money request to User A
    3. User A opens the report
    4. User A changes the workspace to workspace in step 1
    5. Verify the report LHN's last message has no HTML
    D. Move expense to another report
    1. Create an expense in a WS chat
    2. Create a new empty report
    3. Open the expense report in step 1
    4. Press the Report field and change to the empty report
    5. Now open the expense report from step 2
    6. Verify the report LHN's last message has no HTML
    E. Submit expense with markdown description
    1. Open a DM chat
    2. Submit an expense with a description that contains markdown
    3. Verify the DM last message doesn't show HTML tag
    F. Submit expense with multiline description
    1. Create a money request with multiline description in a DM
    2. Press the search icon on the top right
    3. Verify the expense report last message shows in 1 line

    Do we agree 👍 or 👎

  14. abekkala commented on Oct 27, 2025

    @abekkala
    Contributor

    PAYMENT SUMMARY FOR OCT 27

    • Fix: @bernhardoj [$250] payment via NewDot
    • PR Review @QichenZhu [$250] payment sent via Upwork and contract ended!

    Thanks! 🎉

  15. bernhardoj commented on Oct 27, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  16. changed the title [-][Due for payment 2025-10-27] [Due for payment 2025-10-22] [Due for payment 2025-10-06] [$250] Chat - Message sent is not shown correctly in LHN[/-] [+][Due for payment 2025-11-03] [Due for payment 2025-10-27] [Due for payment 2025-10-22] [Due for payment 2025-10-06] [$250] Chat - Message sent is not shown correctly in LHN[/+] on Oct 27, 2025
  17. melvin-bot commented on Oct 27, 2025

    @melvin-bot

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

  18. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.38-5 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 2025-11-03. 🎊

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

  19. melvin-bot commented on Oct 27, 2025

    @melvin-bot

    @bernhardoj / @QichenZhu @abekkala The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  20. quinthar commented on Nov 2, 2025

    @quinthar
    Contributor

    $250 approved to @bernhardoj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorInternalRequires API changes or must be handled by Expensify staffWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions