[Avatars - Reports] If a report contains the expenses of one person, only display their avatar + fix isOneTransactionReport#64802
Conversation
|
Going to run a test build quickly 🚀 |
|
🚧 @shawnborton has triggered a test Expensify/App build. You can view the workflow run here. |
That was quick, the design team is always on its toes 😄 |
|
You don't know how badly I want to fix this one 🤣 |
|
The IOU report opens only after clicking on the report preview. So, when the receiver logs in and sees the preview in the DM, the iouReport and its actions are not yet available. As a result, areIOUActionsOnlyFromOnePerson returns false, and both names are shown (as seen at 00:00 in the video). Once the report preview is clicked and the IOU report opens, the report actions become available, and the display updates correctly. Screen.Recording.2025-06-25.at.11.49.03.AM.mov |
|
@c3024 Ah, yes, missing data in Onyx. I believe this is a common scenario, and I have seen data missing until the report is opened before. A recent comment on another PR:
I think there should be a dedicated PR to fix the fact that Onyx is not up to date, but CC: @mountiny @luacmartins for opinion. |
This comment has been minimized.
This comment has been minimized.
|
Ah, I think I am reporting the same thing as above. It seems to work after I view the report and then go back to the chat. |
|
Yeah, Onyx data is missing, same thing. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppavatarAndroid.movAndroid: mWeb ChromeavatarAndroidmWeb.moviOS: HybridAppavatariOS.moviOS: mWeb SafariavatariOSmWeb.movMacOS: Chrome / SafariavatarChrome1.movavatarChrome2.movMacOS: DesktopavatarDesktop.mov |
|
I think it would be better to include the step of opening the preview and then navigating back to the report in the QA steps, so that QA does not think that the PR did not fix it. |
isOneTransactionReportisOneTransactionReport
0456598 to
84b21ba
Compare
|
FYI failing test also fails on main. I also believe that this test is poorly written. Take a look at the results of running the It is not reliable when a different test case fails every time. Also, in this PR, it sometimes failed and sometimes didn't. cc: @mountiny |
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
|
In this IOU report I have, the report preview is using the correct diagonal avatar, but the report itself does not have the same diagonal avatar: CleanShot.2025-07-08.at.11.41.45.mp4 |
|
Are both expenses deleted? There's a bug with reports with deleted transactions |
|
Hmm not deleted but they were in a weird state because they became cancelled - the receiver didn't set up their wallet within 30 days, so the expense reimbursements (p2p, so a money transfer) got cancelled. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪
|
If I got a penny every time @shawnborton had a weird Onyx state, I would already have at least three 😆 I think we should note this issue here just in case: #65559. However, it may be a specific edge case, so I would focus on it last. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.1.79-0 🚀
|
|
@JakubKorytko This PR is failing with this issue. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.79-11 🚀
|






Explanation of Change
We want to display only the sender's avatar everywhere if it only contains one person's expenses. Initially the PR was to do it only for report preview, but right now it do that for report header as well. The rest of avatars in the app (LHN, details etc.) will be fixed as part of resolving this issue: #65559
We achieve that by a new local hook
useReportAvatarDetailsandSingleReportAvatarcomponent. It performs the following checks to determine if the report preview is a single avatar:isOneTransactionReport#64802 (comment)isOneTransactionReport#64802 (comment)There are still problems with Onyx actions that can lead to stale avatars, see summary here: #64802 (comment). If actions are always up to date, we can remove the two conditionals, and rely only on the following check:
There is also logic for the Send Money flow:
PR fixing
isOneTransactionReport#64734 was merged into this PR as it is the same logic area. The problem is that the functiongetOneTransactionThreadReportIDnever returns null; it always returns undefined. Therefore,isOneTransactionReportalways returns true.What has been done to fix that:
ReportUtilsGetIconsTestwas brought back and corrected.EnforceActionExportRestrictions.isOneTransactionReportreturn value was corrected.Also fixed a comment mentioned here: #64228 (comment)
Fixed Issues
$ #62869
$ #64333
PROPOSAL: N/A
Tests
[Display only the sender's avatar next to the report preview if it only contains one person's expenses]
[Fix
isOneTransactionReport]Offline tests
Same as tests.
QA Steps
Same as tests.
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))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
Web.mov
Web.mp4
Web_2.mov
MacOS: Desktop