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 2023-06-28] [$1000] Web - Split Bill - Profile picture still shows avatar on a new split money page #20118

Closed
1 of 6 tasks
kbecciv opened this issue Jun 3, 2023 · 60 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jun 3, 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. Open NewDot staging on web chrome.
  2. Create a workspace (if you don't already have one). Invite a second member to the workspace.
  3. Go to the workspace's announce room.
  4. Split a bill between the two workspace members.
  5. Click the bill split from within the announce room (so it opens the RHN with the details of the bill split.)
  6. Click the settings tab and change your profile image.
  7. Go back to the announce room, click into the bill split, and notice that your old profile image is display in the details page.

Expected Result:

Profile picture should be updated on a new split money page

Actual Result:

Profile picture still shows avatar on a new split money page

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: 1.3.22.0

Reproducible in staging?: n/a

Reproducible in production?: n/a

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

avatar.mp4

Expensify/Expensify Issue URL:

Issue reported by: @avi-shek-jha

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015e350d1e95099cb9
  • Upwork Job ID: 1665846988733915136
  • Last Price Increase: 2023-06-12
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Jun 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 3, 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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 3, 2023

Proposal

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

Old Profile picture still shows avatar on a new split money page

What is the root cause of that problem?

The cause is we get payeePersonalDetails from participants that is converted to optionSelector from personalDetails with format here

keyForList: details.login,
login: details.login,
text: details.displayName,
firstName: lodashGet(details, 'firstName', ''),
lastName: lodashGet(details, 'lastName', ''),
alternateText: Str.isSMSLogin(details.login || '') ? LocalePhoneNumber.formatPhoneNumber(details.login) : details.login,
icons: [
{
source: UserUtils.getAvatar(details.avatar, details.login),
name: details.login,
type: CONST.ICON_TYPE_AVATAR,
},
],
payPalMeAddress: lodashGet(details, 'payPalMeAddress', ''),
phoneNumber: lodashGet(details, 'phoneNumber', ''),

const payeePersonalDetails = _.filter(participants, (participant) => participant.login === reportAction.actorEmail)[0];

While getIOUConfirmationOptionsFromPayeePersonalDetail fuction get data from fields that follow personalDetailsPropType.
function getIOUConfirmationOptionsFromPayeePersonalDetail(personalDetail, amountText) {

Because personalDetail.avatar and personalDetail.displayname is undefined, text is email or phone number instead of display name
text: personalDetail.displayName ? personalDetail.displayName : personalDetail.login,

and avatar is default avatar instead of current avatar
source: UserUtils.getAvatar(personalDetail.avatar, personalDetail.login),

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

We have two solution to fix payee issue

  1. In SpliBillDetailPage, we get payeePersonalDetails from personalDetails instead of participants
    const payeePersonalDetails = _.filter(participants, (participant) => participant.login === reportAction.actorEmail)[0];
  2. In getIOUConfirmationOptionsFromPayeePersonalDetail function, we only need return personalDetail and other fields that we need because personalDetail now was converted to option
return {
    ...personalDetail
    descriptiveText: amountText,
};

What alternative solutions did you explore? (Optional)

@GItGudRatio
Copy link
Contributor

GItGudRatio commented Jun 3, 2023

Proposal

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

In this issue, we can notice that when we open the Split Bill Details Page, the payee's avatar is not shown correctly.

What is the root cause of that problem?

The root cause behind this issue is that the default avatar URL is passed to the avatar component instead of the user avatar.

This happens because to get the payee's user details, we use the OptionsListUtils.getIOUConfirmationOptionsFromPayeePersonalDetail function. This uses the personalDetails.avatar to get the user's avatar. This is not correct because the payee's details in this.props.payeePersonalDetails are of the format:

{
    "icons": [
        {
            "source": "https://d1wpcgnaa73g0y.cloudfront.net/0fb18190762aaf5fa9f5f91acd2b54a0bbc520f1_128.jpeg",
            "name": "...",
            "type": "avatar"
        }
    ],
    "payPalMeAddress": "",
    "phoneNumber": ""
}

const formattedPayeePersonalDetails = OptionsListUtils.getIOUConfirmationOptionsFromPayeePersonalDetail(
this.getPayeePersonalDetails(),
CurrencyUtils.convertToDisplayString(myIOUAmount, this.props.iou.selectedCurrencyCode),
);

source: UserUtils.getAvatar(personalDetail.avatar, personalDetail.login),

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

If there is no props.payeePersonalDetails, it fallbacks to this.props.currentUserPersonalDetails, which has the personalDetails.avatar property. A good way to fix this issue would be to use ternary operators to check if the property avatar exists on the personalDetails object, then use that property else look for icons[0].source or vice versa and pass that to the UserUtils.getAvatar accordingly.

What alternative solutions did you explore? (Optional)

Alternatively, we can modify the personal details prop to use avatar instead of the icons array.

const payeePersonalDetails = _.filter(participants, (participant) => participant.login === reportAction.actorEmail)[0];

@melvin-bot melvin-bot bot added the Overdue label Jun 5, 2023
@joekaufmanexpensify
Copy link
Contributor

joekaufmanexpensify commented Jun 5, 2023

I can reproduce this. Interestingly, the profile image in the LHN and in the settings tab is also not updating right away after changing it. Although both do update after refreshing the session. Whereas the image on the bill split detailed page does not.

@melvin-bot melvin-bot bot removed the Overdue label Jun 5, 2023
@joekaufmanexpensify
Copy link
Contributor

2023-06-05_18-15-42.mp4

@joekaufmanexpensify joekaufmanexpensify added External Added to denote the issue can be worked on by a contributor and removed Needs Reproduction Reproducible steps needed labels Jun 5, 2023
@melvin-bot melvin-bot bot changed the title Web - Split Bill - Profile picture still shows avatar on a new split money page [$1000] Web - Split Bill - Profile picture still shows avatar on a new split money page Jun 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 5, 2023

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

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

melvin-bot bot commented Jun 5, 2023

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

@parasharrajat
Copy link
Member

Reviewing...

@joekaufmanexpensify
Copy link
Contributor

Sounds good, thanks @parasharrajat !

@joekaufmanexpensify
Copy link
Contributor

@parasharrajat are we good to proceed with either of these proposals?

@joekaufmanexpensify
Copy link
Contributor

Bumped proposals in slack here

@parasharrajat
Copy link
Member

parasharrajat commented Jun 9, 2023

Solution 1 from @dukenv0307 's proposal looks good to me. It seems a simple mistake that we get the payee's personal details from the participants. We do need an option structure for the payee to render but we have a function to convert the personal details to option type. As we fallback to current user personal details, it is clear that payeePersonalDetails should be some type of currentuserpersonalDetails and

getPayeePersonalDetails() {
should return the same type.

cc: @flodnv

🎀 👀 🎀 C+ reviewed

@bernhardoj
Copy link
Contributor

Sharing my opinion:

I think @dukenv0307 2nd proposal looks better. Filtering personalDetails (especially in HT account) doesn't sounds good.

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2023
@parasharrajat
Copy link
Member

parasharrajat commented Jun 12, 2023

personalDetails are indexed based on login so IMO, it is O(1) to get the details when we have a login. Also, OptionsListUtils.getPersonalDetailsForLogins can be used for this purpose.

Am I missing something?

@melvin-bot melvin-bot bot added the Daily KSv2 label Jun 27, 2023
@joekaufmanexpensify
Copy link
Contributor

As soon as the bug-zero checklist is complete here, we'll be all set to issue payment tomorrow!

@parasharrajat
Copy link
Member

parasharrajat commented Jun 27, 2023

[@parasharrajat] The PR that introduced the bug has been identified. Link to the PR:#19390
[@parasharrajat] 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:https://github.com/Expensify/App/pull/19390/files#r1244341085
[@parasharrajat] 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: Not required! it was a simple mistake and proper testing and code review should have caught it.
[@parasharrajat] Determine if we should create a regression test for this bug. Yes
[@parasharrajat] 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. #20118 (comment)

@parasharrajat
Copy link
Member

parasharrajat commented Jun 27, 2023

Regression Test Steps

  1. Login with any account
  2. Open an announce workspace chat or a group chat
  3. Split bill among members.
  4. Click on the split bill preview to see the details.
  5. Verify that the payee user in detail split bill page displays with the current avatar and display name.
  6. Change the avatar of the login user.
  7. Go back to the preview of the split bill following steps 2 & 4.
  8. Verify that the payee avatar is changed.

Verify that no errors appear in the JS console

Do you agree 👍 or 👎 ?

@parasharrajat
Copy link
Member

@joekaufmanexpensify Please hold my payment for now. I will ping you soon with further details.

@joekaufmanexpensify
Copy link
Contributor

Sounds good, thanks! I will create the regression test issue tomorrow.

@flodnv
Copy link
Contributor

flodnv commented Jun 28, 2023

I think the regression test sounds good as long as QA agrees it's not too niche... 👍

@joekaufmanexpensify
Copy link
Contributor

Sounds good. Added regression test issue above. BZ checklist is now complete!

@joekaufmanexpensify
Copy link
Contributor

All set to issue payment here! @parasharrajat I know your payment is held right now, but going to issue the others.

@joekaufmanexpensify
Copy link
Contributor

@dukenv0307 $1,000 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@avi-shek-jha $250 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Leaving this open until we are all set to pay @parasharrajat

@joekaufmanexpensify
Copy link
Contributor

Held pending being able to pay rajat.

@melvin-bot melvin-bot bot added the Overdue label Jul 3, 2023
@joekaufmanexpensify
Copy link
Contributor

Not overdue. Pending being able to issue payment here.

@melvin-bot melvin-bot bot removed the Overdue label Jul 3, 2023
@joekaufmanexpensify
Copy link
Contributor

Payment to rajat still on hold. Bumped in Slack.

@parasharrajat
Copy link
Member

@joekaufmanexpensify It will be better to make this weekly.

@joekaufmanexpensify joekaufmanexpensify added Weekly KSv2 and removed Daily KSv2 labels Jul 5, 2023
@joekaufmanexpensify
Copy link
Contributor

Still on hold

@joekaufmanexpensify
Copy link
Contributor

Bumped in Slack

@joekaufmanexpensify
Copy link
Contributor

Checking in on whether we are all set to pay this.

@joekaufmanexpensify
Copy link
Contributor

Bumped in Slack.

@parasharrajat
Copy link
Member

Payment requested. Ref: #20118 (comment)

@joekaufmanexpensify
Copy link
Contributor

Thanks! Copying the payment summary message here. No speed bonus here, so these are the relevant payments:

@joekaufmanexpensify
Copy link
Contributor

Closing for now, since all that's left is NewDot payment (which has been requested)!

@JmillsExpensify
Copy link

Reviewed details for @parasharrajat. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

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

No branches or pull requests

8 participants