Fix IOU avatar overlap when sharing manual and scanned expenses#87961
Fix IOU avatar overlap when sharing manual and scanned expenses#87961marufsharifi wants to merge 11 commits intoExpensify:mainfrom
Conversation
…nd scanned expenses between users
|
@aimane-chnaif 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] |
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad5a635fc2
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Did you fix #87096 (comment)? |
JmillsExpensify
left a comment
There was a problem hiding this comment.
Very good test cases. Product approved.
@aimane-chnaif Yes, Could you please take another look, thanks |
|
Please add unit test for the last fix |
|
@aimane-chnaif Added, please check. Thanks! |
|
@aimane-chnaif, kindly bump. thanks. |
|
@marufsharifi please merge main |
|
There's regression. When create new scan request while existing requests, IOU preview is separately shown (as if new report) and then merged into existing report. Screen.Recording.2026-04-20.at.4.26.08.pm.mov |
|
Interestingly, I reproduced the above bug on |
This is still failing. The case is: A submitted multiple requests to B and B didn't submit any request to A. Screen.Recording.2026-04-20.at.4.37.39.pm.mov |
|
Can you please throughly test yourself before requesting re-review and bump? |
|
@aimane-chnaif, I’ve thoroughly tested all scenarios and recorded them and included them in the PR checklist. Could you please take another look - thanks |
Explanation of Change
This change makes the report preview avatar logic more cautious for scan expenses.
Before, the app could treat a zero-amount scan expense as if its sender was known, which sometimes caused a 1:1 chat preview to show a single combined avatar incorrectly when one person had sent both a manual expense and a scan expense.
Now we use the most reliable signal first: if the related IOU actions tell us who created each expense, we trust that. If that data is not available, we only fall back to transaction amounts when the direction is actually clear. For zero-value scan expenses that are still unresolved, we stop guessing and keep the preview ambiguous instead of showing the wrong single-avatar state.
Fixed Issues
$ #82488
PROPOSAL: #82488 (comment)
Tests
Other Test Cases:
1. Zero Amount Request
2. Clear Cache /
iouActionsUnavailable3. Two Devices (IOS & MacOS Web)
Offline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2026-04-03.at.7.55.45.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-04-03.at.7.47.19.PM.mov
iOS: Native
Screen.Recording.2026-04-03.at.7.37.22.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-04-03.at.7.41.11.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-04-03.at.7.16.56.PM.mov
REC-2026041681116.AM.mp4
REC-2026041683058.AM.1.1.1.mp4
Screen.Recording.2026-04-16.at.8.19.03.AM.mp4
REC-2026042225400.PM.mp4
REC-2026042230036.PM.mp4
REC-2026042230708.PM.mp4
REC-2026042231305.PM.mp4