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
[$500] User avatars aren't showing on Tasks #31372
The avatar is supposed to be retrieved from the personalDetails onyx object, but it's undefined because we are not subscribing the object from the onyx, so the avatar here is always an empty string, thus a default avatar is used.
For the second issue, the LHN avatar is coming from ReportUtils.getReportIcon. It takes the assigner (owner) avatar from the personalDetails onyx object.
In the case of a task, the report participants only contain the assignee (manager). So, when we are trying to get the avatar of the owner, we get nothing, and again, the default avatar is used.
What changes do you think we should make in order to solve the problem?
// filter out account ID of 0. ownerAccountID can be 0 if it's not a task.
const participants = [itemFullReport.ownerAccountID, ...itemFullReport.participantAccountIDs].filter((p) => p !== 0);
or
const participants = [...itemFullReport.participantAccountIDs]
if (itemFullReport.ownerAccountID > 0) {
participants.push(itemFullReport.ownerAccountID);
}
const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails);
This issue is long overdue. The corresponding PR was deployed to production on 7th of December. It caused this regression - #32416. We successfully fixed that regression in this PR and it was also deployed to product on 7th of December.
Activity
melvin-bot commentedon Nov 15, 2023
Triggered auto assignment to @miljakljajic (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Nov 15, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)DylanDylann commentedon Nov 16, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
App/src/components/ReportActionItem/TaskView.js
Line 150 in 5e01376
props.personalDetailsis undefined because we do not subscribeONYXKEYS.PERSONAL_DETAILS_LISTApp/src/components/LHNOptionsList/OptionRowLHNData.js
Line 90 in 1ddd581
with the
personalDetailsis from the below logic:App/src/components/LHNOptionsList/LHNOptionsList.js
Line 142 in 1ddd581
report.participantAccountIDsdoes not contain the owner `s accountID, that leads to the default avatar displayedWhat changes do you think we should make in order to solve the problem?
ONYXKEYS.PERSONAL_DETAILS_LISTin TaskView:function getParticipantsIDs(report) { ... + if (isMoneyRequestReport(report) || isTaskReport(report)) { return _.chain([report.managerID, report.ownerAccountID, ...participants]) .compact() .uniq() .value(); } return participants; }App/src/components/LHNOptionsList/LHNOptionsList.js
Line 142 in 1ddd581
to:
What alternative solutions did you explore? (Optional)
allPersonalDetailsthat is subscribed in OptionsListUtils if the paramallPersonalDetailsis emptyResult
[-]User avatars aren't showing on Tasks [/-][+][$500] User avatars aren't showing on Tasks [/+]melvin-bot commentedon Nov 16, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e392efbd2033f1dc
melvin-bot commentedon Nov 16, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)bernhardoj commentedon Nov 16, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
For the first issue, the assignee avatar is coming from this line of code.
App/src/components/ReportActionItem/TaskView.js
Line 151 in 6ea4539
The avatar is supposed to be retrieved from the
personalDetailsonyx object, but it's undefined because we are not subscribing the object from the onyx, so the avatar here is always an empty string, thus a default avatar is used.App/src/libs/OptionsListUtils.js
Lines 140 to 144 in 6ea4539
For the second issue, the LHN avatar is coming from
ReportUtils.getReportIcon. It takes the assigner (owner) avatar from thepersonalDetailsonyx object.App/src/libs/ReportUtils.js
Lines 1159 to 1166 in 6ea4539
However, the
personalDetailsobject that is passed down fromLHNOptionsListcomponent only contains the personal details of the report participants.App/src/components/LHNOptionsList/LHNOptionsList.js
Line 142 in 6ea4539
App/src/components/LHNOptionsList/LHNOptionsList.js
Line 151 in 6ea4539
In the case of a task, the report participants only contain the assignee (manager). So, when we are trying to get the avatar of the owner, we get nothing, and again, the default avatar is used.
What changes do you think we should make in order to solve the problem?
TaskView.ownerAccountIDin the personal details.App/src/components/LHNOptionsList/LHNOptionsList.js
Line 142 in 6ea4539
31 remaining items
Julesssss commentedon Nov 28, 2023
Regardless of how the feature currently works, we only need to resolve the initial bug. Lets not increase scope here.
We should go with @bernhardoj's proposal.
alitoshmatov commentedon Nov 28, 2023
Thank you
@bernhardoj You can proceed with PR
bernhardoj commentedon Nov 28, 2023
PR is ready
cc: @alitoshmatov
alitoshmatov commentedon Dec 21, 2023
This issue is long overdue. The corresponding PR was deployed to production on 7th of December. It caused this regression - #32416. We successfully fixed that regression in this PR and it was also deployed to product on 7th of December.
Julesssss commentedon Dec 21, 2023
Ah thanks, it looks like our automation failed to add the 'HOLD for payment' warning. Does this sound right?
Julesssss commentedon Dec 21, 2023
Hey @miljakljajic, would you mind paying this one out? Thanks
alitoshmatov commentedon Jan 4, 2024
@miljakljajic Friendly bump
miljakljajic commentedon Jan 4, 2024
So sorry, paying right away!
miljakljajic commentedon Jan 4, 2024
Paid in upwork.