Stop displaying User info in SearchResults row if user missing or fake#49158
Conversation
|
@ikevin127 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] |
|
@luacmartins @puneetlath in regards to this conversation: https://swmansion.slack.com/archives/C049HHMV9SM/p1725454490800639 Can you drop a list of steps to reproduce this case where a user can have unsubmitted transaction and gets a |
|
I think the steps is something like: Pre-condition:
|
| const {isLargeScreenWidth} = useResponsiveLayout(); | ||
| const avatarURL = participant?.avatar; | ||
|
|
||
| if (displayName === CONST.REPORT.OWNER_EMAIL_FAKE || displayName === '') { |
There was a problem hiding this comment.
I know that the transactionItem.managerID === 0 check, which if true returns emptyPersonalDetails would always return the displayName as empty string, which would make the next paragraph non-valid but I thought I should mention it for the case (not sure it will ever exist) where transactionItem.managerID !== 0 but the displayName is __fake__.
Note: In this case we should also ensure the shouldDisplayArrowIcon is handled accordingly.
I noticed in the Slack conversation screenshot (see below) that the __fake__ displayName was lowercase and here we're checking for equality between displayName (which can be lowercase) and CONST.REPORT.OWNER_EMAIL_FAKE which is __FAKE__ (uppercase) - which might cause an edge case where this logic won't return early because both checks will fail.
As a fix I'd recommend either uppercasing displayName for this check, or lowercasing both.
@luacmartins Wdyt ?
There was a problem hiding this comment.
Ah nice catch. Yea, we should make the comparison case insensitive
There was a problem hiding this comment.
makes sense and I can update, but then Im curious why we get the lowercase __fake__ in the first place? Is it backend that produces this value? In the App I get 0 results when searching for __fake__.
Reviewer Checklist
Screenshots/Videos |
|
Will 🟢 Approve as soon as observation in #49158 (comment) is addressed. |
61c1c2f to
77bc236
Compare
|
@ikevin127 all done, now |
ikevin127
left a comment
There was a problem hiding this comment.
Thanks for addressing the comment, LGTM 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.37-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.0.38-4 🚀
|






Details
__fake__user dataUserInfoCellI made the code handlingmanagerIDinsideSearchUtilsto be more explicit. In case we get managerID === 0 in special cases, we now handle this with fallbackNote: I was not actually able to reproduce the state of "unsubmitted Expensify Card transaction" (I don't know how) so I did not get the
__fake__user name; I tested this PR by manually makingSearchUtils.getTransactionsSections()return some missing user data.Fixed Issues
$ #48582
PROPOSAL:
Tests
__fake__is not displayed in user cell in case of missing resultsOffline tests
QA Steps
Frombut the arrow icon is not there andTocolumn is emptyPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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
MacOS: Desktop