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
[$1000] Task - Avatar for the same new user is different in Assignee and Share somewhere fields #24078
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
To get display information of the shareDestination, Task.getShareDestination is called and you'll get the icons by getIconsForParticipants function.
That is, you'll get the icons for the assignee and shareDestination with the same function and same parameters([participantAccountIDs], personalDetails).
The main problem is accountID. When open the new chat with new account, OpenReport API returns new personalDetails data and new [participantAccountIDs]. So we use old optimistic accountID for assignee(from onyx store), and use new accountID for shareDestination(from report). That's why shareDestination and assignee has the same icon for a while, and has different icon after that.
This is the root cause.
What changes do you think we should make in order to solve the problem?
When open new report with new account, OpenReport API returns new personalDetails data and new [participantAccountIDs]. So personalDetails has two account information for the same user, one is optimistic data, the other is one returned from the API.
Remove the old one when API successes. Add the following code here
@s-alves10 in my opinion, participant ID should not change if participant.loginText === assignee.loginText. Currently, a new participant is being created even when one already exists.
Please re-state the problem that we are trying to solve in this issue.
Task - Avatar for the same new user is different in Assignee and Share somewhere fields
What is the root cause of that problem?
When selecting a new assignee on creating task flow, we will generate a new accountID for the new assignee, and use this accounID to display the assignee field.
Then we call OpenReport API and the server returns another accounID for the new assignee. This accountID is used to display the share destination field
The problem here is that we use 2 accountIDs for the same user
What changes do you think we should make in order to solve the problem?
After the server returns the accountID we should re-set assigneeAccountID to this accountID. With this approach, we only have one accountID for new assignee.
To do that,
here, we should save reportID to task field on ONYX
After the server returns the accountID we should re-set assigneeAccountID to this accountID. With this approach, we only have one accountID for new assignee.
I think this makes sense, but let's get an expert opinion. I'm not sure how these differ, but it sounds like they're basically both solving the optimistic extra accountID in different ways. Regardless, this is a bug.
changed the title [-]Task - Avatar for the same new user is different in Assignee and Share somewhere fields[/-][+][$1000] Task - Avatar for the same new user is different in Assignee and Share somewhere fields[/+]on Aug 3, 2023
BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors
Activity
melvin-bot commentedon Aug 2, 2023
Triggered auto assignment to @twisterdotcom (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 2, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)dummy-1111 commentedon Aug 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Avatar for the same new user is different in assignee and share destination fields
What is the root cause of that problem?
When task is created with a new user, new chat is created with the new user and set the new
reportIDto theshareDestination.App/src/libs/actions/Task.js
Lines 530 to 543 in 2f750ad
Please note
openReportis calledTo get display information of the assignee,
Task.getAssigneeis called and you'll get the icons byReportUtils.getIconsForParticipantsApp/src/libs/actions/Task.js
Lines 584 to 588 in 2f750ad
To get display information of the shareDestination,
Task.getShareDestinationis called and you'll get the icons bygetIconsForParticipantsfunction.That is, you'll get the icons for the
assigneeandshareDestinationwith the same function and same parameters([participantAccountIDs],personalDetails).The main problem is accountID. When open the new chat with new account,
OpenReportAPI returns newpersonalDetailsdata and new[participantAccountIDs]. So we use old optimistic accountID for assignee(from onyx store), and use newaccountIDforshareDestination(from report). That's whyshareDestinationand assignee has the same icon for a while, and has different icon after that.This is the root cause.
What changes do you think we should make in order to solve the problem?
When open new report with new account,
OpenReportAPI returns newpersonalDetailsdata and new[participantAccountIDs]. SopersonalDetailshas two account information for the same user, one is optimistic data, the other is one returned from the API.Task.getAssignee, add additional parameterprops.task.assignee(this is an assignee login)To find the new accountID, add the following code in
getAssigneefunction in Task.jsThis way we can synchronize the
assigneeandshareDestinationResult
24078.mp4
What alternative solutions did you explore? (Optional)
spcheema commentedon Aug 3, 2023
@s-alves10 in my opinion, participant ID should not change if
participant.loginText === assignee.loginText. Currently, a new participant is being created even when one already exists.dummy-1111 commentedon Aug 3, 2023
@spcheema
This is the case for the new account. I'm afraid I didn't catch you.
Will you explain in more detail?
dukenv0307 commentedon Aug 3, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Task - Avatar for the same new user is different in Assignee and Share somewhere fields
What is the root cause of that problem?
When selecting a new assignee on creating task flow, we will generate a new accountID for the new assignee, and use this accounID to display the assignee field.
App/src/libs/actions/Task.js
Line 546 in 2f750ad
Then we call OpenReport API and the server returns another accounID for the new assignee. This accountID is used to display the share destination field
The problem here is that we use 2 accountIDs for the same user
What changes do you think we should make in order to solve the problem?
After the server returns the accountID we should re-set assigneeAccountID to this accountID. With this approach, we only have one accountID for new assignee.
To do that,
here, we should save reportID to task field on ONYX
App/src/libs/actions/Task.js
Line 546 in 2f750ad
Create new method to update assigneeAccountID in Task.js
Result
Screen.Recording.2023-08-03.at.14.53.41.mov
twisterdotcom commentedon Aug 3, 2023
From @s-alves10:
From @dukenv0307:
I think this makes sense, but let's get an expert opinion. I'm not sure how these differ, but it sounds like they're basically both solving the optimistic extra accountID in different ways. Regardless, this is a bug.
[-]Task - Avatar for the same new user is different in Assignee and Share somewhere fields[/-][+][$1000] Task - Avatar for the same new user is different in Assignee and Share somewhere fields[/+]melvin-bot commentedon Aug 3, 2023
Job added to Upwork: https://www.upwork.com/jobs/~013ee9160400af123a
melvin-bot commentedon Aug 3, 2023
Current assignee @twisterdotcom is eligible for the External assigner, not assigning anyone new.
33 remaining items
sakluger commentedon Sep 18, 2023
@aimane-chnaif what's the next step here? Do we need brand new proposals?
melvin-bot commentedon Sep 21, 2023
@sakluger, @twisterdotcom, @aimane-chnaif Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
aimane-chnaif commentedon Sep 21, 2023
yes, now awaiting new proposals.
For contributors who previously posted proposals:
please update proposals based on latest codebase
melvin-bot commentedon Sep 22, 2023
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon Sep 25, 2023
@sakluger, @twisterdotcom, @aimane-chnaif Whoops! This issue is 2 days overdue. Let's get this updated quick!
sakluger commentedon Sep 25, 2023
@s-alves10 @dukenv0307 @StevenKKC would you like to submit an updated proposal?
dukenv0307 commentedon Sep 25, 2023
@sakluger Actually we block assigned task for new user, so this issue cannot reproduce now.
sakluger commentedon Sep 29, 2023
Ah okay, I'll close it.