Open IuliiaHerets opened 1 week ago
Triggered auto assignment to @sonialiap (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@sonialiap FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Edited by proposal-police: This proposal was edited at 2024-09-11 13:13:15 UTC.
Task – Assignee avatar is default for task creator when is assigned by user B
We are using selector to get the avatar here
https://github.com/Expensify/App/blob/fc33ac1ac35248ecf888bb8d4e8e04b5e72cc56e/src/components/ReportActionItem/TaskPreview.tsx#L77
because the taskAssigneeAccountID
didn't exist initially (0
) when the selector was defined on the first render, after the task is assigned the selector
will still fetch for the prev taskAssigneeAccountID 0
because selector will determined on the first render
We should instead use
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST);
const avatar = personalDetails?.[taskAssigneeAccountID]?.avatar;
useOnyx
is not triggered during renders, could be useOnyx
bug could be intentional functionality of useOnyx
hook.useOnyx
and verified it's not triggered between renders.)useOnyx
we could instead use usePersonalDetails
hook to fetch personalDetails
and then fetch avatar from personalDetails
and use FallbackAvatar along.
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
const avatar = personalDetails?.[taskAssigneeAccountID]?.avatar || FallbackAvatar;
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Job added to Upwork: https://www.upwork.com/jobs/~021835623974546752724
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (External
)
A task assignee custom avatar displays as default avatar in room/group/1:1 chat
the use of useOnyx with a selector and hooked on the key ONYXKEYS.PERSONAL_DETAILS_LIST is the issue. When a task is unassigned, the assignee account ID is 0 and the selector at its first run will retrieve an avatar corresponding to the default avatar
"0": { "accountID": 0, "avatar": "https://.../avatars/default-avatar_1.png", "firstName": "", "lastName": "" }
When the task is self assigned by B, the selector dont rerun because useOnyx with a selector will only update the avatar value only if the key’s data changes, which does not happen. So the avatar is not rerendered to display the custom avatar based on the assignee account ID.
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT; const assigneeAvatar = taskAssigneeAccountID > 0 ? personalDetails[taskAssigneeAccountID]?.avatar:Expensicons.FallbackAvatar; const htmlForTaskPreview =
<comment>${taskTitle}</comment>
;
and then
{taskAssigneeAccountID > 0 && ( <Avatar containerStyles={[styles.mr2, styles.alignSelfCenter, isTaskCompleted ? styles.opacitySemiTransparent : undefined]} source={assigneeAvatar} size={CONST.AVATAR_SIZE.SMALL} avatarID={taskAssigneeAccountID} type={CONST.ICON_TYPE_AVATAR} /> )}
https://github.com/user-attachments/assets/3214dcff-d126-4413-a082-e7652e52b244
📣 @Kalydosos! 📣 Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: rnel2@hotmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~0182b95dfd9db2cbea
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
@FitseTLT's proposal looks good to me.
usePersonalDetails
is better but this is something that can be addressed in PR stage.
🎀👀🎀 C+ reviewed
Triggered auto assignment to @francoisl, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
📣 @mkhutornyi 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻 Keep in mind: Code of Conduct | Contributing 📖
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.0.32-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4945911 Email or phone of affected tester (no customers): applausetester+jp_e_category_2@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to https://staging.new.expensify.com/
Log in as user A
Navigate to room chat where user B with custom avatar is a member
Create a task without assignee and stay in the room chat, not open task details
Log in as user B on another tab/device and open this task it the room
As user B assign task to me
Observe the room chat for user A (task creator)
Expected Result:
Task assignee avatar is custom avatar in the room chat
Actual Result:
Task assignee avatar is default in room chat. The same when create a task in a group chat and 1:1 chat
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/c0fb533c-3e01-402d-ac98-7dfd590a18ca
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @mkhutornyi