-
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
[$500] Report gets blank after resizing #31503
Comments
Triggered auto assignment to @mallenexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~0195fdcb43d1c84e8f |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
Was able to reproduce after watching vid, def something we want t ofix. I feel like a version of this bug has existed before, I couldn't find any GHs for it though. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Report becomes blank What is the root cause of that problem?The What changes do you think we should make in order to solve the problem?In here, calculate the
The logic is the same as the existing Then we can clean up the existing What alternative solutions did you explore? (Optional)NA |
ProposalPlease re-state the problem that we are trying to solve in this issue.When on a report, and switching screen to the small view (mobile), clicking back on the report (which takes you to LHN), and then switching back to desktop view, central panel will be empty. The same happens if you load the app on mobile view (which will land you on LHN) and expanding the window to desktop size, no central panel will be loaded. What is the root cause of that problem?The root problem is is the sequence in which things are rendered. The app is structured this way (very simplified)
When you switch from mobile to desktop (and vice versa), these components would all re-render because they all relay on App/src/libs/Navigation/NavigationRoot.js Lines 74 to 80 in 3f7e66a
When What changes do you think we should make in order to solve the problem?We need to delay calling
We can remove the use effect from useEffect(() => {
if (!navigationRef.isReady()) {
return;
}
// We need to force state rehydration so the CustomRouter can add the CentralPaneNavigator route if necessary.
navigationRef.resetRoot(navigationRef.getRootState());
}, [isSmallScreenWidth]); That will bring the logic closer to where it affects while making sure it only calls
useEffect(() => {
if (!navigationRef.isReady() || !props.authenticated) {
return;
}
// We need to force state rehydration so the CustomRouter can add the CentralPaneNavigator route if necessary.
setTimeout(() => {
navigationRef.resetRoot(navigationRef.getRootState());
}, 0);
}, [isSmallScreenWidth, props.authenticated]); Wrapping the call to What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Report becomes blank when switching from desktop to mobile view, pressing back button and then going back to the desktop view What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?In the |
@mallenexpensify I think similar to this bug: #28354 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Upon resize windows from large -> small -> large size in width, central pane navigator doesnt gets loaded. What is the root cause of that problem?Root cause of the problem is that CustomRouter below is not getting rehydrated based on screen size changes
the variable getting used to monitor screen size change is react state variable
What changes do you think we should make in order to solve the problem?Instead of entirely depending upon getRehydratedState for adding central pane we can use getStateForAction which can be triggered based on certain condition e.g. screen size changed So basically as soon as screen size changes we can call following code in
and in CustomRouter add something like this besides getRehydratedState App/src/libs/Navigation/AppNavigator/createCustomStackNavigator/CustomRouter.js Lines 65 to 70 in 3f7e66a
As per my testing this fixes the issue. What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Thanks @tsa321 for the link. |
Hey @alitoshmatov, about the issue you brought up: first, we tried sorting it out with useWindowDimensions, but it still caused some hiccups. The trouble really roots in our reliance on getRehydratedState, which is an internal callback in React Navigation. This callback kicks off the addition of a central pane, but we can't directly call it ourselves. So, for any tweaks we need after navigation loads, we've gotta find a different way. I suggested using another approach to reach that central pane when state changes. I'd love to hear your take on this. @narefyev91 and @arosiclair, your thoughts matter too. What do you all think? |
My solution does manually call |
My fixed PR is created so long ago, I also tried to figure out why this issue resurfaced but there was no outcome. I see all proposals point out the same RCA: The getRehydratedState is run before the useWindowDimensions hook render again, that why I strongly believe it's the correct RCA. What do you think? @alitoshmatov |
@m-natarajan are there any updates related to this issue? |
Okay, I also couldn't find why this issue occurred again. The RCA you provided is correct. Reviewing proposals. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
ProposalPlease re-state the problem that we are trying to solve in this issue.Report gets blank after resizing What is the root cause of that problem?The What changes do you think we should make in order to solve the problem?In here, calculate the const windowWidth = Dimensions.get('window').width;
const isSmallScreenWidth = windowWidth <= variables.mobileResponsiveWidthBreakpoint; The above code is for the web platforms. For native devices, the The logic is the same as the existing Then we can clean up the existing What alternative solutions did you explore? (Optional)NA |
@alitoshmatov I can raise the new PR with original solution with minor fixes for iPad. (This is mostly 2-3 lines addition). |
@alitoshmatov I also believe you might have to try on larger screen ipad |
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.25-10 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-01-24. 🎊 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:
|
This can be closed... right? |
@mallenexpensify We reverted the change so its still broken. @alitoshmatov needs to review the proposal here to fix this again. So can you reopen this again? |
Yep, you're right, reopening as we reverted the PR that fixed it. We should determine whether @tienifr and @alitoshmatov should work to fix (again) since they were the original assignees, or whether we want to open it up again. Thanks! |
I am a little bit confused. @shubham1206agra your proposal is exactly the same as @tienifr 's, Are you suggesting that reimplementing this solution is correct approach. If yes, I think I and @tienifr can reimplement this easily since it is the same old solution. I am happy to review it without any payment. |
Reimplementing with little changes. But let's wait for Ideal Nav to stabilize to check the repro of the issue. Edit - Looks like the issue will be fixed. Lets wait for the Ideal Nav to hit production. |
@shubham1206agra That looks like a plan, I do agree with holding this issue since this issue is an edge case |
Posted in the Wave 8 room. to check |
I'm going to close this. Coming from the internal slack discussion
If/when we want to address resizing we'll be able to easily find this issue cuz |
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.0.3
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: @shubham1206agra
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1700236291136659
Action Performed:
(watch the vid before you try to reproduce, it'll be more clear)
Expected Result:
All the messages should be loading
Actual Result:
Report becomes blank
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Recording.243.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: