Closed lanitochka17 closed 8 months ago
Triggered auto assignment to @lschurr (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)Job added to Upwork: https://www.upwork.com/jobs/~01a81bbd7ec35b9394
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External
)
Is this only on staging with beta? I can't repo on dev with beta on
On Desktop - FAB - Modal for 'Send Message' freezes when opened
The root cause of the problem is due to heavy rendering on src/pages/NewChatSelectorPage.js when the modal is opened that causing animation delay in the rendering process.
We should optimize the rendering of the components in the NewChatSelectorPage modal. via lazy loading NewChatPage
to load the component only when needed.
Here below is the example code, with the result
import React, {lazy} from 'react';
//.. Other codes
// Lazy load NewChatPage, so the animation is smoother and load the data after Modal is opened
const NewChatPage = lazy(() => import('./NewChatPage'));
//.. Other codes
function NewChatSelectorPage(props) {
return (
<ScreenWrapper
shouldEnableKeyboardAvoidingView={false}
includeSafeAreaPaddingBottom={false}
shouldEnableMaxHeight
testID={NewChatSelectorPage.displayName}
>
<HeaderWithBackButton title={props.translate('sidebarScreen.fabNewChat')} />
{Permissions.canUsePolicyRooms(props.betas) ? (
<OnyxTabNavigator
id={CONST.TAB.NEW_CHAT_TAB_ID}
tabBar={({state, navigation, position}) => (
<TabSelector
state={state}
navigation={navigation}
position={position}
/>
)}
>
<TopTab.Screen
name={CONST.TAB.NEW_CHAT}
component={() => (
//.. Use Suspense to make sure that the component is loaded
//.. we can use another component as the fallback as well
<Suspense fallback={null}>
<NewChatPage />
</Suspense>
)}
/>
<TopTab.Screen
name={CONST.TAB.NEW_ROOM}
component={WorkspaceNewRoomPage}
/>
</OnyxTabNavigator>
) : (
//.. Use Suspense to make sure that the component is loaded
//.. we can use another component as the fallback as well
<Suspense fallback={null}>
<NewChatPage />
</Suspense>
)}
</ScreenWrapper>
);
}
NewChatSelectorPage.propTypes = propTypes;
NewChatSelectorPage.defaultProps = defaultProps;
NewChatSelectorPage.displayName = 'NewChatPage';
export default compose(
withLocalize,
withWindowDimensions,
withOnyx({
betas: {key: ONYXKEYS.BETAS},
}),
)(NewChatSelectorPage);
https://github.com/Expensify/App/assets/20473526/c39afd56-74e8-4da1-97da-640a9f34cd30
NA
@eVoloshchak @lschurr
@eVoloshchak, @lschurr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Is this only on staging with beta? I can't repo on dev with beta on
@AmjedNazzal, it is reproducible on dev on my end
https://github.com/Expensify/App/assets/9059945/ee32ec51-045c-4ed4-b4b9-459b5ab7f4df
The root cause of the problem is due to heavy rendering on src/pages/NewChatSelectorPage.js
@studentofcoding, lazy loading the component would fix the symptom of the problem, but not the root cause. What is particularly heavy about this page? What's causing those heavy renders?
The root cause of the problem is due to heavy rendering on src/pages/NewChatSelectorPage.js
@studentofcoding, lazy loading the component would fix the symptom of the problem, but not the root cause.
What is particularly heavy about this page? What's causing those heavy renders?
It's on Search List that get fetch & rendered everytime we open the modal @eVoloshchak
But we don't have the same problem when opening the search page (CMD+K). Is it due to skeleton UI?
But we don't have the same problem when opening the search page (CMD+K). Is it due to skeleton UI?
Yes it's @eVoloshchak
Any update here @eVoloshchak?
This is awaiting more proposals I think we need to dig deeper to figure out and fix the actual root cause for this
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@eVoloshchak, @lschurr Whoops! This issue is 2 days overdue. Let's get this updated quick!
Not overdue, this is awaiting more proposals I think we need to dig deeper to figure out and fix the actual root cause for this
Still waiting on proposals.
@eVoloshchak @lschurr this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
I'm not able reproduce this bug.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
@akamefi202, it's still reproducible for me
https://github.com/Expensify/App/assets/9059945/bf65dbc8-17fc-4dce-8314-b7cc2e01b7fd
It's present only on Desktop and only for accounts with policyRooms
beta (or just override canUsePolicyRooms
to return true
@eVoloshchak, @lschurr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Are we still waiting for proposals @eVoloshchak?
@lschurr, yes, this is reproducible, still waiting for proposals
@eVoloshchak @lschurr this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
Triggered auto assignment to @Julesssss (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
Issue not reproducible during KI retests. (First week)
This is still reproducible for me. To test this your account has to be added to the policy rooms
beta
https://github.com/Expensify/App/assets/9059945/69cd7b00-94a8-4e96-8bcc-1ed6c294b87b
Not overdue, still awaiting proposals
Still awaiting proposals. @lschurr maybe we can double the bounty?
Issue not reproducible during KI retests. (Second week)
@eVoloshchak @Julesssss @lschurr this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @eVoloshchak is eligible for the Internal assigner, not assigning anyone new.
Upwork job price has been updated to $1000
Alright, I've updated the bounty on this one.
Still reproducible with high traffic account and canUseAllBetas=true
https://github.com/Expensify/App/assets/9059945/c90d4993-b001-4362-968d-eca94ee8f2ed
While most likely this proposal will not meet the requirements, I'll give it a try anyways because I spent some time / had some fun debugging this and maybe some of my observations might be helpful to the next person attempting to solve it.
Modal freezes when it is opened / sometimes the sliding motion is neglected and it appears immediately without any sliding effect.
The issue is caused by the implementation of SectionList
from this file.
When the right hand navigation modal is opened the component containing this list is also being rendered which causes the freeze due to multiple re-renders of the list loading new options (items) and expensive calculations of the layout every time the list items are rendered but especially the very first time the modal is opened.
Debugging observations:
SectionList
OptionsListSkeletonView
by itself causes performance issues, it's not just the SectionList
which leads one to think that the problem comes from BaseOptionsList
component which contains all the heavy computations related to the SectionList
, including the skeleton loading componentSectionList
props like initialNumToRender, maxToRenderPerBatch and windowSize does not seem to help with this issueMy solution does not fix the problem, but it offers an improvement in performance.
My approach was to use InteractionManager.runAfterInteractions()
with requestAnimationFrame()
inside it in order to delay the rendering of the OptionsSelector
component which includes the search input and SectionList
like so:
// src/pages/NewChatPage.js
const [hasFinishedInteractions, setHasFinishedInteractions] = useState(false);
useEffect(() => {
const runAfterInteractionsTask = InteractionManager.runAfterInteractions(() => {
requestAnimationFrame(() => {
setHasFinishedInteractions(true);
});
});
return () => {
if (runAfterInteractionsTask) {
runAfterInteractionsTask.cancel();
}
setHasFinishedInteractions(false);
}
}, []);
...
// lower in the component return
{hasFinishedInteractions && (
<OptionsSelector
...
This improves the performance slightly by delaying the rendering of the OptionsSelector
component while the navigation transition animation takes place which causes this performance issue.
Looking closely at the videos then going back / forward with the playback cursor we can observe:
before: the modal is just appearing from none to opened on the first opening, no transition-in animation, then there's barely any transition-in animation going on subsequently which is also very janky
@eVoloshchak could you review the proposal?
@ikevin127, a huge thank you for posting your findings here
I don't think the solution you're proposing is the best approach, since
However, recently we've put more emphasis on improving the app performance, I think there is a plan to improve the FlatList performance specifically (I'll try to find the actual discussion on Slack and link it here), which might resolve this issue
Any luck on finding the supporting Slack conversation @eVoloshchak?
@eVoloshchak, @Julesssss, @lschurr Eep! 4 days overdue now. Issues have feelings too...
Sharing this in the performance channel, as this is probably better suited to an agency.
@eVoloshchak, @Julesssss, @lschurr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Any update on this one @Julesssss? Are we holding on this issue?
It was added to the performance project, but doesn't have a status yet.
@muttmuure do we need to do anything else here?
Hi hi - any update on this @muttmuure?
Bump @muttmuure
@eVoloshchak, @Julesssss, @lschurr, @muttmuure Whoops! This issue is 2 days overdue. Let's get this updated quick!
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Modal opens without any lags or freezes
Actual Result:
Modal freezes when it is opened / sometimes the sliding motion is neglected and it appears immediately without any sliding effect
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.78.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/78819774/39206801-5320-47fb-9d9c-2347b8476204
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit