Use deterministic default avatar instead of gray fallback when personal details unavailable#86713
Use deterministic default avatar instead of gray fallback when personal details unavailable#86713allgandalf wants to merge 18 commits intoExpensify:mainfrom
Conversation
|
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95ed97e962
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d4b1793b8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2026-04-10.at.17.18.57.moviOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-04-10.at.17.16.20.web.mov |
|
@allgandalf can you please upload recordings? |
|
@hoangzinh kinda occupied with domain control project today, can you please proceed as it is in the meantime, i will find time later today for this, but don't want to block you from reviewing the code 🙇 |
|
bump @hoangzinh |
@allgandalf just wanna confirm, we will show fallback avatar instead of avatar of [A] in this case, won't we? I did expect that [C] should see avatar of [A] in this case |
|
@MelvinBot what do you think about this #86713 (comment) |
|
Good question. Test step 9 ("chats where no accountID exists") is about an edge case where the accountID itself is undefined/null — not the User A/B/C scenario. In the User C scenario from the test steps:
You can see this in the diff — places where an accountID might be undefined keep the source: actorDetails?.avatar ?? (actorAccountID ? getDefaultAvatarURL({accountID: actorAccountID}) : FallbackAvatar)So to directly answer: yes, User C should see a colorful avatar for User A (not gray), since User A's accountID is available. The gray fallback is only for truly unknown users (no accountID at all), which is a rare edge case. |
|
@MelvinBot so i need to update my test case right ? |
|
Yes — test step 9 is confusing as written because the User A/B/C scenario always has accountIDs. I'd suggest either:
Either way, the reviewer's point is valid — in the described scenario, User C should see User A's colorful avatar, not a gray fallback. |
|
can you please give me updated test steps |
|
@MelvinBot #86713 (comment), also please update PR description accordingly |
|
Updated the PR description with clearer test steps. Key changes:
|
@hoangzinh are you blocked on anything else from my side? |
|
@allgandalf, my original question is: when user [A] uploaded their avatar. So should [C] see the avatar of [A] or a colorful default avatar for User [A] in this case? |
|
@hoangzinh great question! C will see A's actual uploaded avatar the BE code at
the FE fix in this PR is just a defensive fallback for the race condition where personalDetails is entirely missing in Onyx (briefly during load). once personalDetails arrive from the BE, C will always see A's actual avatar, whether custom or default |
|
@allgandalf here is what I tested. [C] only sees A's colorful default util [C] click on the chat on LHN, then be able to see A's real avatar Screen.Recording.2026-04-23.at.16.22.55.mov |
Explanation of Change
When a user is invited to an expense report, their personal details may not have loaded yet. In this case, several functions in
ReportUtils.tswere falling back toFallbackAvatar(a generic gray silhouette SVG). This looks wrong because once personal details load, the user gets a deterministic colorful avatar based on their accountID.This PR replaces
FallbackAvatarwithgetDefaultAvatarURL({accountID})in the following functions:getIconsForParticipantsgetParticipantIcongetIconsForExpenseRequestgetIconsForChatThreadgetIconsForIOUReport(both managerIcon and ownerIcon)The two remaining usages of
FallbackAvatarare correct -- they handle cases where no accountID exists at all (this edge case is covered by unit tests).This is a defensive FE improvement. It pairs with a backend fix in Auth that ensures personal details are sent to invitees.
Fixed Issues
$ #85240
PROPOSAL: #85240 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari