-
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
[$1000] Skeleton UI is displayed when clicking on any chat reported by @thesahindia #12635
Comments
Triggered auto assignment to @lschurr ( |
Taking this one, because this is a pretty bad regression and I'd like to raise the price to $1000 immediately. |
Calling all contributors, we need your help resolving this performance regression! Upwork job is here: https://www.upwork.com/jobs/~01d434cec2c2807231. Compensation starts at $1,000. |
Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Triggered auto assignment to @dangrous ( |
@dangrous Can you take at look at this issue and the related Slack thread. We need to figure out a couple of things, though I'm keeping the
And that's probably it for now. Thanks! |
Will investigate! |
Just putting the info I found so far here as well as in Slack: This appears to be caused not by any slow responses from the API, but from a long delayed call to the API -
EDIT: On refresh, we still get a delay before calling |
@dangrous One thing i can add is this (not directly related to this issue): diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js
index 7d6828b01..3e3a300f2 100644
--- a/src/pages/home/ReportScreen.js
+++ b/src/pages/home/ReportScreen.js
@@ -159,7 +159,7 @@ class ReportScreen extends React.Component {
// This is necessary so that when we are retrieving the next report data from Onyx the ReportActionsView will remount completely
const isTransitioning = this.props.report && this.props.report.reportID !== reportIDFromPath;
- return reportIDFromPath && this.props.report.reportID && !isTransitioning && !isLoadingInitialAppData;
+ return reportIDFromPath && this.props.report.reportID && !isTransitioning && isLoadingInitialAppData === false;
}
fetchReportIfNeeded() { initially isLoadingInitialAppData will be undefined and !undefined is true which is not the desired results. Comparing with false is safer. |
Changing the chat will also trigger the skeleton but the chat gets loaded normally after calling OpenReport |
I think the skeleton view loader is not depending on the We use App/src/pages/home/ReportScreen.js Lines 148 to 163 in ae385f9
|
My take here: The issue is happening due to Because I am not able to consistently reproduce this on Web, I haven't debugged the API response. But the I saw this part in
Logs I captured:
What I need to check is if I'll try to dig further but meanwhile if it helps identify the issue further. |
ProposalI can reproduce this with a high-traffic account applausetester+0704sveta@applause.expensifail.com. The issue workarounds don't resolve the issue.
App/src/libs/Middleware/SaveResponseInOnyx.js Lines 16 to 30 in ae385f9
Screen.Recording.2022-11-11.at.13.46.42.movIn my case, the If I'm excluding the So my suggestion is, we should separate the |
@Santhosh-Sellavel thoughts on this latest proposal? |
I think this still needs more investigation. I can (randomly) reproduce the issue even with a barely new account. |
@mollfpr You might be onto something, but as @s77rt I can also reproduce this on low traffic account. I am unable to reproduce every time. Of 3-4 times I reproduced, I've waited for like upto 3-4 mins to see if it loads something but it doesn't and always fails with |
I faced this issue with both low/high traffic accounts, but this has the most impact on high-traffic accounts which is for most of us (for our personal accounts as well)!
Thanks, @mollfpr, I like the idea. If you have a full proposal please submit let's test this one and move this forward quickly! |
I'm able to reproduce it with App that has a session expired. To repro this in the DEV I'm customizing the App/src/libs/Network/enhanceParameters.js Lines 33 to 38 in 0d653ca
if (isAuthTokenRequired(command) && !parameters.authToken) {
finalParameters.authToken = NetworkStore.getAuthToken() + 'test';
} The thing that I found is App/src/libs/Middleware/SaveResponseInOnyx.js Lines 11 to 14 in 0d653ca
So what I understand is, when the App/src/libs/Middleware/Reauthentication.js Lines 87 to 90 in 0d653ca
Because of the promise resolve from We should update the return promise with the response data. diff --git a/src/libs/Middleware/Reauthentication.js b/src/libs/Middleware/Reauthentication.js
index bf1bbad1a..dab836f56 100644
--- a/src/libs/Middleware/Reauthentication.js
+++ b/src/libs/Middleware/Reauthentication.js
@@ -86,7 +86,7 @@ function Reauthentication(response, request, isFromSequentialQueue) {
if (apiRequestType === CONST.API_REQUEST_TYPE.READ) {
NetworkConnection.triggerReconnectionCallbacks('read request made with expired authToken');
- return Promise.resolve();
+ return Promise.resolve(data);
}
MainQueue.replay(request); Before UI.Skeleton.-.Before.movAfter UI.Skeleton.-.After.mov |
That also explains why the App works again after refreshing the page or closing the App. Because the |
Edit : my proposal will only fix this issue #12574 so I posted it in other thread , i agree with @mollfpr proposal #12635 (comment) , there is an update that will not be triggered for 164f309#diff-b900fb367aed6ac57460755de185e8cb616f156a58fbc167b948a700e10889ff this introduced the change and caused the miss update |
Thanks, @fedirjh, that makes sense! |
Cool! @mollfpr's proposal makes sense to me too. @JmillsExpensify just wanted to run by you as well since I want to make sure I'm not missing any context or side effect trickiness from not knowing the codebase as well. Let us know and then we can get this approved, PRd, and merged! |
The proposal by @mollfpr definitely seems like a much bigger bug. Mind if we slow down a bit? For this issue specifically, my read is that there is likely a relationship to slow API calls since, yes, the report page will wait for I added that code so that the "new markers" would work correctly - so we can revert it, but cause a regression to the new markers. I think any proposal here should include that consideration. |
I like slowing down. I also agree that the regression seems to have occurred around not showing anything cached immediately, which is a big problem given that our design is Offline First. |
Pretty sure this is a dupe of this issue -> #12574 I'm reverting my PR here to fix the new marker since I think that's where the trouble started. It does look like there's maybe some other issue related to authentication happening being discussed here. But we should explore it separately since those changes could have far reaching implications. |
Oh thanks for making the connection! Ok, so let's align in this issue what to do for the authentication issue for the time being then, sound good? I can update the title and what not, though we should also really decide if we're going to do anything about this at the moment. These bugs are tricky, as you rightly note. If we aren't going to move forward on the authentication side, then probably better to close out this issue. |
It does sound like the cases where chats are not loading at all are due to an expired |
Cool. I also think we do need to circle back on auth more holistically, as this general consideration keeps biting us. |
Looked into Authentication issues more and I am not seeing where the connection is WRT the skeleton UI issue. It's clear something broke re-authentication at some point. But if your |
Agree |
Alright, so coming back to this one. I think we need to circle back and close this issue, yeah? It being a dupe of #12574 and handled via your PR revert? |
Yeah I think so. But with the caveat that @mollfpr may be onto something with the authentication issues. I think we should:
|
Ok that sounds like a plan! @mollfpr you probably have the best context on this issue, would appreciate you reporting in #expensify-bugs. |
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:
Chat should be loading instantly
Actual Result:
Skeleton UI appears
Workaround:
Refresh the page or close and reopen the app (Native apps)
Platform:
Where is this issue occurring?
Version Number: 1.2.26-0
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
az_recorder_20221110_084137.1.mp4
Expensify/Expensify Issue URL:
Issue reported by: @thesahindia
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1668015943860829
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: