Skip to content

[C+ Checklist Needs Completion] [$250] Expense created offline for new chat shows two avatar #66619

Closed

Description

@nlemma

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: v9.1.82-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: #65921
Email or phone of affected tester (no customers): testpayment935@gmail.com
Issue reported by: Applause Internal Team
Device used: Windows 10 /Chrome, Samsung Galaxy s10/ Chrome. Samsung Galaxy s10/ Android 12
App Component: Chat Report View

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Log in with any account
  3. Go offline
  4. Click green + button > Create expense
  5. Choose any user without IOU in chat and create expense

Expected Result:

Next to the Report Preview only one avatar should display and it's the sender. and also only the sender name above Report Preview should appear.

Actual Result:

When creating an expense offline for a new chat it shows both the users avatar until returning online

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6890429_1752752855345.bandicam_2025-07-17_14-30-11-184.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021947529431034338581
  • Upwork Job ID: 1947529431034338581
  • Last Price Increase: 2025-07-29
  • Automatic offers:
    • mkzie2 | Contributor | 108237115
Issue OwnerCurrent Issue Owner: @shubham1206agra

Activity

  1. added
    Daily
    Bug
    on Jul 17, 2025
  2. melvin-bot commented on Jul 17, 2025

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (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. TMisiukiewicz commented on Jul 17, 2025

    @TMisiukiewicz
    Contributor

    I'll verify this

  4. TMisiukiewicz commented on Jul 17, 2025

    @TMisiukiewicz
    Contributor

    Checked it against my latest changes, answered here: #65921 (comment)

  5. Burhan-Rashid commented on Jul 17, 2025

    @Burhan-Rashid
    Contributor

    Proposal

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

    Expense created offline for new chat shows two avatar

    What is the root cause of that problem?

    While creating the optimistic data for report action preview, we are not setting the childOwnerAccountID in the optimisitic data and due to this we get singleAvatarAccountID as undefined, which inturn makes reportPreviewSenderID as undefined here:

    const singleAvatarAccountID = isSendMoneyFlow ? action.childManagerAccountID : action?.childOwnerAccountID;
    const reportPreviewSenderID = areAmountsSignsTheSame && isThereOnlyOneAttendee ? singleAvatarAccountID : undefined;

    which makes displayAllActors as true here as reportPreviewSenderID is undefined :
    const displayAllActors = isReportPreviewAction && !isTripRoom && !isPolicyExpenseChat(report) && !reportPreviewSenderID;

    which leads to showing multiple avatars:
    const showMultipleUserAvatarPattern = shouldDisplayAllActors && !shouldShowSubscriptAvatar;
    const headingText = showMultipleUserAvatarPattern ? `${primaryAvatar.name} & ${secondaryAvatar.name}` : displayName;

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

    While creating the optimistic data for report preview action, we need to add the childOwnerAccountID here:

    reportActionID: reportActionID ?? rand64(),

            childOwnerAccountID: currentUserAccountID,

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

    N/A

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

    Preview:

    childaccountid.mp4
  6. mkzie2 commented on Jul 17, 2025

    @mkzie2
    Contributor

    Proposal

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

    When creating an expense offline for a new chat it shows both the users avatar until returning online

    What is the root cause of that problem?

    Let's see the logic here, singleAvatarAccountID is getting from childManagerAccountID/childOwnerAccountID data of the report preview action. But the optimistic report preview action doesn't set this data here

    const singleAvatarAccountID = isSendMoneyFlow ? action.childManagerAccountID : action?.childOwnerAccountID;
    const reportPreviewSenderID = areAmountsSignsTheSame && isThereOnlyOneAttendee ? singleAvatarAccountID : undefined;

    Then showMultipleUserAvatarPattern is true since singleAvatarAccountID is undefined

    const displayAllActors = isReportPreviewAction && !isTripRoom && !isPolicyExpenseChat(report) && !reportPreviewSenderID;

    const showMultipleUserAvatarPattern = shouldDisplayAllActors && !shouldShowSubscriptAvatar;
    const headingText = showMultipleUserAvatarPattern ? `${primaryAvatar.name} & ${secondaryAvatar.name}` : displayName;

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

    We should set childManagerAccountID and childOwnerAccountID data for the report preview action based on iouReport param. We shouldn't always set childOwnerAccountID as the current user because for the send money flow the current user is the manager, not the owner. Follow iouReport data is always correct

    childOwnerAccountID: iouReport.ownerAccountID,
    childManagerAccountID: iouReport.managerID,
    

    return {

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

    Update buildOptimisticReportPreview unit test to verify childOwnerAccountID, childManagerAccountID is correct

    What alternative solutions did you explore? (Optional)

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  7. added
    External
    on Jul 22, 2025
  8. changed the title [-]Expense created offline for new chat shows two avatar[/-] [+][$250] Expense created offline for new chat shows two avatar[/+] on Jul 22, 2025
  9. melvin-bot commented on Jul 22, 2025

    @melvin-bot
  10. added
    Help Wanted
    on Jul 22, 2025
  11. melvin-bot commented on Jul 22, 2025

    @melvin-bot

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

  12. 24 remaining items

  13. melvin-bot commented on Aug 15, 2025

    @melvin-bot

    @shubham1206agra @greg-schroeder 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]

  14. added
    Daily
    and removed
    Weekly
    on Aug 21, 2025
  15. greg-schroeder commented on Aug 22, 2025

    @greg-schroeder
    Contributor

    Payment summary:

    Contributor: @mkzie2 - $250 - Upwork
    C+: @shubham1206agra - $250 - Manual request via ND

  16. greg-schroeder commented on Aug 22, 2025

    @greg-schroeder
    Contributor

    @shubham1206agra can you take care of the C+ checklist so we can close this out?

  17. changed the title [-][Due for payment 2025-08-22] [$250] Expense created offline for new chat shows two avatar[/-] [+][C+ Checklist Needs Completion] [$250] Expense created offline for new chat shows two avatar[/+] on Aug 22, 2025
  18. removed
    Awaiting Payment
    on Aug 22, 2025
  19. shubham1206agra commented on Aug 24, 2025

    @shubham1206agra
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [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: Fix: missing avatars and names above IOU preview in main chat after login  #42453 (comment)

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

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

      Link to issue:

    Regression Test Proposal

    Test:

    1. Open any DM chat without IOU
    2. Go offline
    3. Create an expense
    4. Verify that the report preview only shows the owner's avatar

    Do we agree 👍 or 👎

  20. trjExpensify commented on Sep 1, 2025

    @trjExpensify
    Contributor

    $250 approved for @shubham1206agra

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

Metadata

Metadata

Labels

BugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions