-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-04-09] [$500] Profile page opens with a lag when clicking from a chat #37986
Comments
Triggered auto assignment to @trjExpensify ( |
offending PR as I mentioned earlier in slack: #37223 |
I'm not sure about classifying this as regression... We didn't notice any performance issues when testing #37223. Of course, this can depend on many factors, including the hardware the web app is being tested on. We haven't added any new logic. Before our PR, the API was still called under some conditions. We just made the conditions less strict. This performance glitch must have been present before; it's just more easily observable now. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Profile page lagging when opened. What is the root cause of that problem?After the updates from #37223 Every component using What changes do you think we should make in order to solve the problem?On profile page, we need to check if we already have the profile details available, if so, we don't have to call the API. const profileDetailsAvailable = details.avatar && details.avatarThumbnail && details.displayName && details.login && details.timezone;
useEffect(() => {
if (ValidationUtils.isValidAccountRoute(accountID) && !profileDetailsAvailable) {
PersonalDetails.openPublicProfilePage(accountID);
}
}, [accountID, profileDetailsAvailable]); What alternative solutions did you explore? (Optional)Display a loading indicator as in the avatar modal. If we always need to fetch the API what ever the available details, we can display a loading indicator to give the API the time to turn back the images and to the browser to load it. |
@puneetlath @stitesExpensify as you guys were involved in #36610, do you agree with this assessment or do you think this is a regression from the PR? |
I think that both things are true. The performance issue did exist under some conditions, but that PR has caused it to happen under all conditions. To me that is a regression since this was not happening all of the time before and is happening now. |
@kmbcook Could you take a look at this? |
#36610 is unusual in that it requires the API to be called every time an avatar is clicked. Most issues are about improving some aspect of user experience, such as this one. 36610 is different in that it is about implementing a specified method of operation (not about improving a specified aspect of user experience). It is true that always calling the API does solve some problems, and that there may be other ways to solve those problems. It may be appropriate to create additional issues specific each of those problems and invite proposals. This issue is not a regression, rather it is a consequence of implementing the method of operation required by the other issue. |
Question: if you already have the personal details locally for userA. And then you open the profile page of userA which calls the API and returns/merges the same personal details that you already have. Why does anything re-render? Nothing in Onyx or any of the props has actually changed right? |
The personalDetails prop to ProfilePage contains a list of personal details for all users in the high traffic account (a lot of data), not just the personal details of the user whose profile is shown in that page. It might be a good idea to change the page so that it only depends upon the personal details of one user. |
Doesn't Onyx have to do a lot of work to determine that nothing in personalDetails has actually changed (assuming no changes), after the merge to personalDetails which results from the API call? All that work is done on the client. Is that why a lag is observed? |
Can we use the selector feature of withOnyx to only subscribe to personalDetails updates for the one accountID we're looking at? |
OK, I'd be willing to propose that as a solution to this issue. |
@kmbcook No proposal is needed. If you agree that this is a good solution to the uncovered performance problem, implement it and see if you observe the improvement. If you can easily reproduce the problem in the first place, of course. |
I used Chrome performance to measure the time between clicking the avatar and seeing the profile page appear. I only took two or three measurements in each scenario. Using withOnyx selector actually slowed response time slightly, for some reason. Using a high-traffic account, and never making the API call, response time is still slow and only slightly faster than always making the API call. Never making the API call, I see a substantial difference between low-traffic and high-traffic accounts. The biggest difference is between opening a profile page for the first time and re-opening that same page. |
What are the next steps, here? Are we assigning @cubuspl42 and @kmbcook? |
@trjExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
This seems like its own problem in and of itself. If we don't make the API call and it's still slow then there must be something wrong on the front end right? |
I think that it's been decided that the answer is "no". |
Got it, so |
Yes, @tienifr 's main proposal here looks good to me as well. |
Cool, so are we assigning @tienifr then? :) |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @tienifr 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR ready for review #38756. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.58-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2024-04-09. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
👋 Checklist time please, @c3024! |
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
Regression test proposal
👍 or 👎 |
👋 Payment summary as follows:
We have a regression test for testing opening the profile from a user in a conversation, so I think we should be able to catch any noticeable lag or issues with loading that, to the point where we don't need another one. Thanks ya'll, closing! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.49-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1709868083089229
Action Performed:
Expected Result:
Profile page should appear smoothly
Actual Result:
It's a bit laggy when Profile page appears.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Screen.Recording.2024-03-08.at.10.21.31.mov
Recording.2831.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: