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 overpayment refund] [$1000] Web - Duplicate particpant name and avatar at the top of the Money request message. #25819

Closed
1 of 6 tasks
izarutskaya opened this issue Aug 24, 2023 · 61 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 24, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Login as User A and User B in front of you at the same time.
  2. As User A Open User B chat and request money( make sure it works by avoiding the bugs around IOU feature Now )
  3. As User B Open the same chat and request money from User A.

Expected Result:

Both Patticpants names and avatars should be displayed at the top of the Money request message.

Actual Result:

Duplicate particpant name and avatar ( User A name and avatar ) at the top of the Money request message

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.57-0

Reproducible in staging?: Y

Reproducible in production?:

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

Notes/Photos/Videos: Any additional supporting documentation

Screencast.From.14-08-23.19.38.44.mp4
Recording.1312.mp4

Expensify/Expensify Issue URL:

Issue reported by: @Ahmed-Abdella

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692033869443169

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01fc2d76b91c3cdcd1
  • Upwork Job ID: 1696679786881073152
  • Last Price Increase: 2023-09-20
  • Automatic offers:
    • jjcoffee | Reviewer | 26790515
    • hungvu193 | Contributor | 26790518
    • Ahmed-Abdella | Reporter | 26790520
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 24, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 24, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@spcheema
Copy link
Contributor

spcheema commented Aug 24, 2023

Proposed solution

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

Web - Duplicate the participant's name and avatar at the top of the Money request message.

What is the root cause of that problem?**

Here is the explanation:

When User A requests money then an IOU (XX) report requested A$1.00 is sent to User B

So both avatars are visible on each side. The first avatar action.actorAccountID is User B and the secondary avatar is the IOU report owner (User A)

Now User B requests the money then action.actorAccountID changed with User B

The first avatar action.actorAccountID (which is now B) and the secondary avatar is the IOU report owner (User B) are the same.

if (displayAllActors) {
const secondaryUserDetails = props.personalDetailsList[props.iouReport.ownerAccountID] || {};
const secondaryDisplayName = lodashGet(secondaryUserDetails, 'displayName', '');
displayName = `${primaryDisplayName} & ${secondaryDisplayName}`;
secondaryAvatar = {
source: UserUtils.getAvatar(secondaryUserDetails.avatar, props.iouReport.ownerAccountID),
type: CONST.ICON_TYPE_AVATAR,
name: secondaryDisplayName,
id: props.iouReport.ownerAccountID,
};
} else if (!isWorkspaceActor) {

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

To fix this issue we need to check if it's an iou report then use the associated report owner and manager ID similar to participants list page https://github.com/Expensify/App/blob/main/src/pages/ReportParticipantsPage.js#L61

Updated code will be like:

If actor is same owner then user manage ID

What alternative solutions did you explore? (Optional)

N/A

@hungvu193
Copy link
Contributor

Proposal

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

Web - Duplicate participant name and avatar at the top of the Money request message.

What is the root cause of that problem?

We're always getting the second user detail from ownerAccountID here:

const secondaryUserDetails = props.personalDetailsList[props.iouReport.ownerAccountID] || {};
const secondaryDisplayName = lodashGet(secondaryUserDetails, 'displayName', '');

So when the ownerAccountID is also the person who request the money, it will cause this issue, because now the secondaryUserDetails is also the currentUserDetails.

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

We should add a new condition to identify the secondaryUserId:

const secondaryAccountId = props.iouReport.ownerAccountID === actorAccountID ? props.iouReport.managerID : props.iouReport.ownerAccountID;

Then use it below:

    if (displayAllActors) {
        const secondaryUserDetails = props.personalDetailsList[secondaryAccountId] || {};
        const secondaryDisplayName = lodashGet(secondaryUserDetails, 'displayName', '');
        displayName = `${primaryDisplayName} & ${secondaryDisplayName}`;
        secondaryAvatar = {
            source: UserUtils.getAvatar(secondaryUserDetails.avatar, secondaryAccountId),
            type: CONST.ICON_TYPE_AVATAR,
            name: secondaryDisplayName,
            id: secondaryAccountId,
        };
    }

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Aug 28, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

@mallenexpensify Eep! 4 days overdue now. Issues have feelings too...

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Aug 30, 2023
@melvin-bot melvin-bot bot changed the title Web - Duplicate particpant name and avatar at the top of the Money request message. [$1000] Web - Duplicate particpant name and avatar at the top of the Money request message. Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 30, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 30, 2023

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

@mallenexpensify
Copy link
Contributor

Was able to reproduce, seems like it'd be External

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Aug 30, 2023
@mallenexpensify
Copy link
Contributor

@situchan can you please review @hungvu193 's proposal above? #25819 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@mallenexpensify mallenexpensify removed their assignment Sep 4, 2023
@mallenexpensify mallenexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

Triggered auto assignment to @adelekennedy (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot

This comment was marked as off-topic.

@mallenexpensify
Copy link
Contributor

@adelekennedy I'm off this week, can you please keep 👀 on this then I'll snag it back on Monday? Thx

@mallenexpensify mallenexpensify self-assigned this Sep 4, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 6, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Display both names for IOU Report Previews #23043
  • 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: Display both names for IOU Report Previews #23043 (comment)
  • 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 - just required more thorough testing
  • 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 Proposal

  1. Login as User A and User B in front of you at the same time.
  2. As User A request money from User B
  3. As User B request money from User A
  4. Verify that the IOU preview displays two different avatars and display names

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot removed the Overdue label Oct 13, 2023
@jjcoffee
Copy link
Contributor

@mallenexpensify Checklist complete, and a friendly bump on the payment!

@melvin-bot melvin-bot bot added the Overdue label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

@hungvu193, @mallenexpensify, @jjcoffee, @hayata-suenaga Whoops! This issue is 2 days overdue. Let's get this updated quick!

@hayata-suenaga
Copy link
Contributor

melvin, we're waiting for payment

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@mallenexpensify
Copy link
Contributor

mallenexpensify commented Oct 17, 2023

Issue reporter: @Ahmed-Abdella paid $250 via Upwork
Contributor: @hungvu193 paid $500 via Upwork, inc urgency bonus
Contributor+: @jjcoffee paid $500 via Upwork, inc urgency bonus

Regression Test

@jjcoffee can you confirm there wasn't a regression from the PR for this issue? I see a comment above but not anything in the PR #27912

@jjcoffee
Copy link
Contributor

Thanks @mallenexpensify! I wasn't able to repro the regression that @situchan commented here when retesting with just our PR, so it must have come from some other change.

@situchan
Copy link
Contributor

Thanks @mallenexpensify! I wasn't able to repro the regression that @situchan commented here when retesting with just our PR, so it must have come from some other change.

Please check the root cause in #28554 (comment)

@melvin-bot melvin-bot bot added the Overdue label Oct 20, 2023
@hayata-suenaga
Copy link
Contributor

As @situchan suggested, theres seem to be a regression from this PR. @jjcoffee if you don't think otherwise, I think we can consider that a regression happened.

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2023
@jjcoffee
Copy link
Contributor

@hayata-suenaga Ohh my apologies, I thought I wasn't able to repro with just our PR, but actually I misunderstood this comment as meaning that the behaviour was happening for manual requests too, but apparently it was only for distance + scans. Agree now that there was indeed a regression. Sorry for the confusion!

@mallenexpensify
Copy link
Contributor

Ok, I'm updating the above for payment to account for the regression and removing the urgency bonus (per CONTRIBUTING.md )

the assigned Contributor and Contributor+ are not eligible for the 50% urgency bonus

I've requested refunds of $1k from @hungvu193 and @jjcoffee , will leave this issue open til I confirm the funds have been refunded.

@jjcoffee
Copy link
Contributor

Will need a few days before my account gets topped back up enough to issue the refund. Sorry about this mess!

@melvin-bot melvin-bot bot added the Overdue label Oct 26, 2023
@hayata-suenaga
Copy link
Contributor

Melvin, we're waiting for the refound

@melvin-bot melvin-bot bot removed the Overdue label Oct 26, 2023
@mallenexpensify mallenexpensify changed the title [HOLD for payment 2023-10-09] [$1000] Web - Duplicate particpant name and avatar at the top of the Money request message. [HOLD for overpayment refund] [$1000] Web - Duplicate particpant name and avatar at the top of the Money request message. Oct 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Oct 30, 2023
@jjcoffee
Copy link
Contributor

@mallenexpensify Refunded! 🙇

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2023
@mallenexpensify
Copy link
Contributor

Thanks @jjcoffee and @hungvu193, confirming the refunds and that the total payment was $500 each.

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

9 participants