Skip to content

[Due for payment 2026-10-28] [Metrics] Investigate and optimize the first message in a chat #103609

Closed

Description

@cristipaval

Problem

The first message in a chat is slower than messages grouped with other messages. This matters for report chats where someone sends one short message, such as "OK", and then moves on.

Scope

Measure the first ungrouped message against grouped messages, identify where the extra time is spent, and improve the slow path. Verify the result with the same measurement before and after the change.

Parent

Part of #95584
Tracked in #95584 (comment)

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    Reviewing
    on Oct 14, 2026
  2. added
    Daily
    and removed
    Reviewing
    Weekly
    on Oct 21, 2026
  3. melvin-bot commented on Oct 21, 2026

    @melvin-bot

    @Julesssss / @cristipaval @LukasMod

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.15-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

  4. melvin-bot commented on Oct 26, 2026

    @melvin-bot

    @LukasMod Huh... This is 4 days overdue. Who can take care of this?

  5. 7 remaining items

  6. changed the title [-][Metrics] Investigate and optimize the first message in a chat[/-] [+][Due for payment 2026-10-28] [Metrics] Investigate and optimize the first message in a chat[/+] on Nov 3, 2026
  7. rojiphil commented on Nov 4, 2026

    @rojiphil
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      No offending PR to comment on since this is a performance improvement.

    • [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: Not Required.

    • [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.

    Regression Test Proposal

    The tests itself may not be needed since this may already be covered elsewhere. Nevertheless, adding the test cases here for QA to cross-check

    Precondition:

    Test:

    Test 1: Smoke, message avatars in chats

    1. As A, open a DM with B, a workspace chat, and an expense report thread in turn.
    2. In each, as A and as B, send a message right after the other account's message.
    3. Confirm each ungrouped message shows the correct sender avatar.
    4. Confirm avatars do not flicker or change when a new message arrives.

    Test 2: Avatars still update on real report changes
    Prerequisite: A is an admin of the workspace.

    1. As A, open the workspace chat and keep it on screen.
    2. Rename the workspace and change its avatar from another session.
    3. Confirm the workspace avatar and name on existing messages update without a reload.

    Test 3: Report preview sender while a receipt is scanning
    Prerequisite: account A has a DM with account B.

    1. As A, scan a receipt in the DM with B and submit it.
    2. While the preview still shows "Scanning", confirm the preview avatar is A
    3. Send a chat message in the same DM.
    4. Confirm the preview avatar is still A and does not flicker.
    5. When the scan finishes, confirm the preview avatar is still A

    Do we agree 👍 or 👎

  8. added
    Weekly
    Daily
    Awaiting Payment
    and removed
    Daily
    Weekly
    on Nov 4, 2026
  9. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  10. melvin-bot commented on Nov 4, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  11. mallenexpensify commented on Nov 4, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @rojiphil due $175 via NewDot

  12. quinthar commented on Nov 15, 2026

    @quinthar
    Contributor

    Approved $175 to @rojiphil

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

Metadata

Metadata

Labels

Awaiting PaymentDaily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions