-
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
Fix/24389 - Request a money - Clicking on the avatar open a wrong profile #24624
Fix/24389 - Request a money - Clicking on the avatar open a wrong profile #24624
Conversation
@narefyev91 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] |
@narefyev91 I am currently experiencing issues while building ios & android apps on emulators. I'll upload videos for both ios & android later. Other than that PR is ready for review |
Reviewer Checklist
Screenshots/VideosWebweb.movweb.movMobile Web - Chromeandroid-web.movandroid-web.movMobile Web - Safariios-web.movios-web.movDesktopdesktop.movdesktop.moviOSios.movios.movAndroidandroid.movandroid.mov |
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!
🎀 👀 🎀 C+ reviewed
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.
Investigating potential crash
Small note - during testing some other PR - get crashes on Android - which shows that props.iouReport.reportID - props.iouReport was undefined - not sure why. But tested on the latest main - was not able to reproduce |
9798a1e
to
b84c560
Compare
I can see from the logs you have shared participants list is undefined. and thanks for sharing logs, it helped to quickly spot the issue. |
I believe we are only fixing for IOU message. Reason being I discussed here the behaviour of header clicking and then agreed to fix clicking on an avatar in request only. |
I mentioned here that we should be fixing this in all cases in which it wasn't working, even the IOU header. |
It's not a big one I'll have a look. |
@pecanoro Can you please decide regarding this #24389 (comment)? |
@narefyev91 PR is ready for review. Now clicking on avatars in the request money header will show the details page for multiple participants and profiles page if there is only one: Here is the discussion:
|
…atar-open-a-wrong-profile
…atar-open-a-wrong-profile
@pecanoro Checked latest code and record additional videos for test cases - looks good from my side |
Testing everything again! |
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.
It's working well from what I tested!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
cc @pecanoro, We have an open PR to implement the Details page for Expense/IOU reports : |
@@ -111,7 +111,7 @@ function ReportActionItemSingle(props) { | |||
|
|||
// If this is a report preview, display names and avatars of both people involved | |||
let secondaryAvatar = {}; | |||
const displayAllActors = props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport; | |||
const displayAllActors = useMemo(() => props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport, [props.action.actionName, props.iouReport]); |
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.
There is no need to use useMemo
here. I don't understand why it's used
Please tell me if I missed something
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.
We should use it because - it's used inside deps for useCallback - const showActorDetails = useCallback(() => {,
and any new render will create displayAllActors (without memo) which will re-creates useCallback - which should not be
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.
either we should not use useMemo and useCallback or should use it correctly with memoizing deps
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.
displayAllActors
would change depends on props.action.actionName
and props.iouReport
regardless the use of useMemo
. If those props don't change, displayAllActors
won't be changed.
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.
yes - and if displayAllActors (if we use useMemo) will not changed - useCallback will also not be changed
Without useMemo - displayAllActors will be as usual variable - which will be re-created every time - and will cause re-creation of useCallback
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 agree with @s-alves10 (this one). Btw, displayAllActors
will return props.iouReport
object if it's true instead of a boolean. I think we should wrap it with a Boolean? (Boolean(props.iouReport))
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.
After some checks - i agree that simple passed variable will not trigger recreation of useCallback. Here can be 2 options either leave as it's now in case props.iouReport is object and useMemo needed here or refactor as @bernhardoj suggested to Boolean(props.iouReport) and remove useMemo. I think it's not critical
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.
If nothing is going to break, I think we can leave it as is and maybe we can clean up in the future. It's just semantics, I also missed it, I thought it was necessary, but it is also true you guys are probably more knowledgable about React that me 😄
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.
@pecanoro @narefyev91 Is there any action we need to take now? Or we have decided to refactor later.
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.
We good to jump on it later
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.3.57-0 🚀
|
🚀 Deployed to staging by https://github.com/pecanoro in version: 1.3.58-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.57-6 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.58-5 🚀
|
Details
Fixed Issues
$ #24389
PROPOSAL: #24389 (comment)
Tests
Scenario 1.
Scenario 2.
Offline tests
QA Steps
Scenario 1.
Scenario 2.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Web.mp4
Mobile Web - Chrome
Mobile.-.chrome.mp4
Mobile Web - Safari
Mobile.-.safari.mp4
Desktop
Desktop.1.mp4
iOS
Screen.Recording.2023-08-17.at.12.45.37.pm.mp4
Android
Re_.Meet.-.buf-ooot-azm.-.17.August.2023.mp4