-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop displaying User info in SearchResults row if user missing or fake #49158
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -17,6 +17,10 @@ function UserInfoCell({participant, displayName}: UserInfoCellProps) { | |||
const {isLargeScreenWidth} = useResponsiveLayout(); | |||
const avatarURL = participant?.avatar; | |||
|
|||
if (displayName === CONST.REPORT.OWNER_EMAIL_FAKE || displayName === '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice catch. Yea, we should make the comparison case insensitive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 dataUserInfoCell
I made the code handlingmanagerID
insideSearchUtils
to 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
From
but the arrow icon is not there andTo
column is emptyPR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop