-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Pinned browser tab fails to reload sometimes after computer wake #22721
Comments
Could we tag this as
rust community request
|
I see a very similar issue without a pinned tab and using Safari. In my case, the images and CSS appear to be loaded (I neglected to grab a screenshot of this page, unfortunately). Like @carols10cents, this feels like an issue that occurs when I put my laptop to sleep and open it later. Today, I believe I left my laptop closed for about four days. My console logs are similarly not very expressive:
|
Full disclosure: @shepmaster and I are on the same network 99% of the time. But unless it's DNS or something like that, I don't think it's relevant... (famous last words) |
I have also had this issue multiple times from multiple locations and networks and always after resuming my laptop. |
Thanks for the report, folks! It's likely that the issue is fairly subtle. What is happening here is that Zulip is asking the browser to reload, which it does if you've been disconnected from the server for more than 10 minutes (and we've thus garbage-collected your real-time push queue). And the browser is not processing our request to reload. (And the little textual message appears after N seconds of the browser having not changed state after the request to reload). When we've had this class of issue in the past, it's largely been browser energy saving features that are choosing to ignore Zulip's request to reload the browser window entirely. They have sometimes disappeared without changes in Zulip due to browsers improving their algorithms. However, a common cause that could be fixed in Zulip is if the Zulip app is consuming more CPU than would be ideal in steady state, since that can impact the browser's model for how expensive the Zulip tab is and thus whether it should not run its code until a user clicks into it. I'd consider running a browser profiler to see if Zulip is using CPU in the background for you; this can be caused by animated GIFs/emoji being visible as that's fundamentally how animated GIFs work (which we're trying to work around for Zulip in #20464 and related PRs), or sometimes by regressions in the highly performance-optimized right sidebar live update logic. Another possibility, suggested by the HTTP 303 exception in your browser console, is that your VPN or network driver or something was still booting at the time that the Zulip window tried to reload, and rejected the network request in a way that caused retries to not occur. It's possible to simulate a garbage-collection related reload on a browser by sending this API request with the browser's queue_id captured from the Developer Tools' Network tab. Hopefully this background is enough for one of you to do a bit of debugging to narrow this down towards something that can be reproduced and fixed. |
Hello @zulip/server-misc members, this issue was labeled with the "area: misc" label, so you may want to check it out! |
Hi @timabbott! Do you have a link to instructions on running a browser profiler in Firefox that would produce useful output for you?
I'm not using a VPN... do you have a suggestion on how to get more information from browser logs to see if this is the case? I've turned on "persist logs" for the console and network tabs of the browser developer tools to try and capture everything that happens when I hit this problem, does that sound like it will be useful? |
Ok, so I left "persist logs" on in the browser console and I caught an instance of this bug. I've downloaded all the messages and I'm happy to share that if that would be helpful, but here's what looks important/interesting to me: I closed my laptop right at 17:00 (quittin' time) and opened it again around 19:30. Right at 17:00, I see these successful requests to
Then at 17:01 I see a request to
Then the next thing I see is this message in the logs at 17:17 and two more requests that don't appear to get responses:
Then the interesting one, a 400 bad request to /json/events:
The browser sending a bad event queue ID doesn't really sound like anything you were supposing, unless I'm misunderstanding? It seems like this request is making it to the server, so it's not a network problem or the browser refusing to reload...? |
Thanks for the investigation! The log output you've posted is I think all expected. The requests not getting responses are presumably networking timeouts due to the client not being online yet when trying to reach the server. Zulip's server=>client push event queues avoid leaking memory by being garbage-collected after 10 minutes of inactivity; the "Bad event queue id" API response is the expected one if your queue has been garbage collected. When the client receives that error, it calls the following function. This does a few things:
What we're seeing empirically here is that the
|
No, I've had this issue for as long as I've used Zulip, since January 9, 2020.
I now have the network tab open and persisting logs and I will try to catch this bug happening.
I've uploaded the profile to profiler.firefox.com, and here's a screenshot as well:
I will go do that right now! EDIT: And done! https://chat.zulip.org/#narrow/stream/9-issues/topic/Pinned.20browser.20tab.20reload.20failing |
Ok, I captured an instance of this happening on chat.zulip.org and I had Firefox's Network tab open, so I exported it as The different thing about this failed reload is that the loading images did load, as opposed to the screenshot of the beginning of this issue where the images were broken. The relevant requests will be near the end of the file.. I did perform a successful manual reload after the failed reload. |
What happens
Sometimes when I open up my laptop after it's been asleep for a while, and I switch to the pinned Firefox tab where I have Zulip, I see this screen that only says "Loading..." with a broken image:
And it seems to change to this with an additional message saying "If this message does not go away, try reloading the page" at the bottom, not sure if the message appears after an amount of time or due to some action I took:
I do have to use the browser reload to reload the page to get Zulip back.
If I don't check this tab soon after waking up my laptop to notice and reload the page, then I miss notifications.
Here are the logs I see in the console, they don't look particularly enlightening... I don't see anything interesting in the Network tab, but if there's something I can investigate next time this happens, please let me know.
Console tab logs
What I expected to happen
Sometimes everything works great, meaning I open up my laptop and switch to the Zulip tab and it has the latest chat messages there-- it was able to reload itself without any errors. This is what I expect to happen all the time.
I haven't been able to figure out any correlation between actions I take or situations and when the reload works or not. I've been trying to catch this issue to report it for about 5 days, and this is the first time it's happened in that time period. I can try and keep track of anything that would be helpful if there are suspicions.
My somewhat-unreliable memories are that it seems to happen more often when I open my computer in the morning after sleeping all night (US Eastern time) rather than during the day... it would make sense to me if it had something to do with server restart overnight? Knowing little to nothing about Zulip's code or operations, this is just a wild guess based on my gut instincts, feel free to ignore me if that doesn't sound likely :)
System information
I know this is rough because I have no way to reproduce this at will. Please please please let me know if there's anything I can log or investigate to help track this down!
The text was updated successfully, but these errors were encountered: