You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-06-28] [$1000] Web - Split Bill - Profile picture still shows avatar on a new split money page #20118
In getIOUConfirmationOptionsFromPayeePersonalDetail function, we only need return personalDetail and other fields that we need because personalDetail now was converted to option
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:
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.
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.
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[/+]on Jun 5, 2023
Activity
melvin-bot commentedon Jun 3, 2023
Triggered auto assignment to @joekaufmanexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 3, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)dukenv0307 commentedon 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
payeePersonalDetailsfromparticipantsthat is converted to optionSelector frompersonalDetailswith format hereApp/src/libs/OptionsListUtils.js
Lines 216 to 230 in 9fa12f3
App/src/pages/iou/SplitBillDetailsPage.js
Line 69 in 9fa12f3
While
getIOUConfirmationOptionsFromPayeePersonalDetailfuction get data from fields that followpersonalDetailsPropType.App/src/libs/OptionsListUtils.js
Line 804 in 9fa12f3
Because
personalDetail.avatarandpersonalDetail.displaynameisundefined,textis email or phone number instead of display nameApp/src/libs/OptionsListUtils.js
Line 806 in 9fa12f3
and avatar is default avatar instead of current avatar
App/src/libs/OptionsListUtils.js
Line 810 in 9fa12f3
What changes do you think we should make in order to solve the problem?
We have two solution to fix payee issue
SpliBillDetailPage, we getpayeePersonalDetailsfrompersonalDetailsinstead ofparticipantsApp/src/pages/iou/SplitBillDetailsPage.js
Line 69 in 9fa12f3
getIOUConfirmationOptionsFromPayeePersonalDetailfunction, we only need returnpersonalDetailand other fields that we need becausepersonalDetailnow was converted to optionWhat alternative solutions did you explore? (Optional)
GItGudRatio commentedon 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.getIOUConfirmationOptionsFromPayeePersonalDetailfunction. This uses thepersonalDetails.avatarto get the user's avatar. This is not correct because the payee's details inthis.props.payeePersonalDetailsare of the format:App/src/components/MoneyRequestConfirmationList.js
Lines 198 to 201 in 0813e2c
App/src/libs/OptionsListUtils.js
Line 810 in 245364f
What changes do you think we should make in order to solve the problem?
If there is no
props.payeePersonalDetails, it fallbacks tothis.props.currentUserPersonalDetails, which has thepersonalDetails.avatarproperty. A good way to fix this issue would be to use ternary operators to check if the propertyavatarexists on thepersonalDetailsobject, then use that property else look foricons[0].sourceor vice versa and pass that to theUserUtils.getAvataraccordingly.What alternative solutions did you explore? (Optional)
Alternatively, we can modify the personal details prop to use avatar instead of the icons array.
App/src/pages/iou/SplitBillDetailsPage.js
Line 69 in 245364f
joekaufmanexpensify commentedon 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.
joekaufmanexpensify commentedon Jun 5, 2023
2023-06-05_18-15-42.mp4
[-]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[/+]59 remaining items
joekaufmanexpensify commentedon Jul 3, 2023
Not overdue. Pending being able to issue payment here.
joekaufmanexpensify commentedon Jul 5, 2023
Payment to rajat still on hold. Bumped in Slack.
parasharrajat commentedon Jul 5, 2023
@joekaufmanexpensify It will be better to make this weekly.
joekaufmanexpensify commentedon Jul 10, 2023
Still on hold
joekaufmanexpensify commentedon Jul 17, 2023
Bumped in Slack
joekaufmanexpensify commentedon Jul 24, 2023
Checking in on whether we are all set to pay this.
joekaufmanexpensify commentedon Jul 31, 2023
Bumped in Slack.
parasharrajat commentedon Aug 1, 2023
Payment requested. Ref: #20118 (comment)
joekaufmanexpensify commentedon Aug 2, 2023
Thanks! Copying the payment summary message here. No speed bonus here, so these are the relevant payments:
joekaufmanexpensify commentedon Aug 2, 2023
Closing for now, since all that's left is NewDot payment (which has been requested)!
JmillsExpensify commentedon Aug 2, 2023
Reviewed details for @parasharrajat. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.