Today Slack has started throwing a spinner on me i...
# present-company
k
Today Slack has started throwing a spinner on me if I return to a tab after some interval (like 5 minutes?). It's kinda hard to even describe this eldritch horror, so bear with me: • I have a tab. It has Slack loaded on it all working. 🎈 • I switch tabs, go off and interact with some other site. • After some time I return to my Slack tab. • I'm faced with a white page with a tiny spinner in its geometric center. 💥 • A few (1-5) seconds later Slack returns. There's no sign of a page reload or anything. • I had to double-check, but I've definitely not restarted my browser or even closed the lid on my laptop in the interim. What.. is this? Is this some new idea in web development? I can't imagine what benefit it could possibly provide anyone. Is it a bug affecting just my computer? I can't conceive what sort of error of omission might lead to it.
i
I wonder if it's some way to deal with getting throttled in the bg? Like, the JS notices that it's been in the background for a while, meaning it doesn't get to check for fresh data, so instead of showing stale data they just block the ui and hit the server when you come back.
k
Ah that helps at least make sense of it. So the idea is that Slack is so mission-critical it can't afford to risk showing outdated information.. 😂
Are you seeing it as well, at least?
(Because I'm assuming JS can easily reify information in the DOM before it gets backgrounded.. but I really don't know much about all this..)
i
I don't see this, perhaps because I use the app rather than the website.
j
I use Slack in the browser, but I don't think I've seen this particular problem yet... (I'm using Firefox on macOS.)
❤️ 1
h
There's a lot of factors that could be at play here: browser, device, device settings/context, HTTP caching/state, client side code, is a service worker involved etc. This behavior could be just one of those things e.g. bad client side code. Or a combination e.g. a device with "data saver" settings working with the browser to aggressively background inactive tabs not playing nicely with a service worker. As a data point I'm using Slack in the browser on MacOS and haven't seen this.
d
This is just a guess, but I'd assume this was the browser unloading the tab to save RAM, and scrambling to get it back! I feel like I've heard of browsers doing such things... but usually it appears from the user's point of view like a full refresh. For it not to have that behaviour the tab would have had to be snapshotted to disk or something...
a
Chrome has a "memory saver" which got turned on by default when it landed, but you can choose differently in settings, I think there are a few levels of aggression to select from! This background tab artifact could be because of that?