News for hackers. Stuff that matters.
Re:Twitter preconnects to the wrong domains by matsemann on Tuesday October 27, 2020 @07:03AM (#24906211)
Twitter is so full of weird connectivity bugs.

For the last weeks until a few days ago I've been unable to access twitter unless doing a hard refresh on every click. Because they installed a faulty service worker of some kind that would break most of the requests. (Both on desktop and android)

And on Android, every time I follow a link to Twitter in an app that opens in a web view, it gives me a faulty page that I have to refresh a few times before I'm able to view it. It loads the page fine, but some rest call or whatever to fetch the tweet crashes.

Edit: Not heard many others complain about this before, so mainly thought it was something about my setup. But the huge amount of upvotes this got suggests some Twitter engineers better look into this..

Re:Twitter preconnects to the wrong domains by the_only_law on Tuesday October 27, 2020 @09:05AM (#24906986)
> And on Android, every time I follow a link to Twitter in an app that opens in a web view, it gives me a faulty page that I have to refresh a few times before I'm able to view it. It loads the page fine, but some rest call or whatever to fetch the tweet crashes.

I get this issue too, I figured it was part of some trick to make me want to use the app.

Re:Twitter preconnects to the wrong domains by wlesieutre on Tuesday October 27, 2020 @09:09AM (#24907022)
Does that on iOS too, every single time
Re:Twitter preconnects to the wrong domains by scsilver on Tuesday October 27, 2020 @08:40PM (#24913710)
Insane that one of the most used websites on the internet doesnt work most of the time.
Re:Twitter preconnects to the wrong domains by wlesieutre on Tuesday October 27, 2020 @10:56PM (#24914574)
Maybe it works when navigated to directly, but the only time I ever go to Twitter is if someone links it from Reddit. And without fail that looks like this: https://imgur.com/fQJ27MF

The button to “Try Again” doesn’t work either, you have to manually reload the page.

This is in Apollo on iOS, but it sounds like the same broken behavior happens in web views on Android.

Re:Twitter preconnects to the wrong domains by noja on Tuesday October 27, 2020 @11:01AM (#24908060)
I thought this was intended: any page load that does not finish within x seconds is aborted. It will normally succeed for me on the reload with the cached assets. I understood this to be a (bad) optimization for rejecting slow clients.
Re:Twitter preconnects to the wrong domains by Polycryptus on Tuesday October 27, 2020 @02:06PM (#24910105)
It does that for me even _in_ the app, so no, it's just broken...
Re:Twitter preconnects to the wrong domains by jerf on Tuesday October 27, 2020 @01:01PM (#24909368)
Thank you for mentioning this. I've been getting frustrated with my Firefox install for a while because everything is so slow and it eats so much memory. After deleting the 200 service workers [1] I didn't even realize were installed, it is taking wildly less memory and seems generally snappier. I wouldn't call it "night and day", but it's faster.

I had been under the impression that service workers required approval from the user to be installed. I had service workers from websites that I haven't visited in years and don't even exist anymore, sitting there chewing on my RAM every time I started Firefox.

Also Twitter has also been broken for me this way for months.

Service workers have some nice features, but I submit that they need to be something to be whitelisted by users, not something websites can just toss in there whenever they feel like it. The odds of one of them screwing up and eating far more resources than they have any right to approach 1 as the number of them increases. I don't know exactly how they managed to collectively eat 2GB of RAM and I don't care; there is no way they were bringing that much value to me, especially as I permit no website to simply push me notifications.

[1]: A suspiciously round number; it was exactly 200. Is that a limit? I don't see it in about:config.

Re:Twitter preconnects to the wrong domains by Aaronn on Tuesday October 27, 2020 @01:59PM (#24910037)
As a data point I've got 299 service workers according to about:debugging#/runtime/this-firefox

Time to remove these. Thanks!

Re:Twitter preconnects to the wrong domains by kiddico on Tuesday October 27, 2020 @02:23PM (#24910245)
And thank you for the link! I was not going to find that one on my own...
Re:Twitter preconnects to the wrong domains by miduil on Tuesday October 27, 2020 @02:55PM (#24910588)
Thank you for the hint with the service workers, quickly checked my settings and figured out that thankfully Cookie Autodelete [0] can take care of those too. Down from ~200+ service workers to a few with my existing configuration.

[0]: https://addons.mozilla.org/en-US/firefox/addon/cookie-autode...

Re:Twitter preconnects to the wrong domains by nitrogen on Tuesday October 27, 2020 @05:39PM (#24912241)
I'm not a fan of service workers myself. Another team at a previous job added a service worker to a site that served many separate backend apps. It caused endless loading, caching, and crashing problems for my team, for no clear benefit.

If you want a cache, use HTTP caching, not custom JS code.

Re:Twitter preconnects to the wrong domains by dashundchen on Tuesday October 27, 2020 @05:22PM (#24912079)
Not just RAM, I noticed on Android 11 that with the broken Twitter service worker installed, Firefox was gobbling up battery as well.

I ignored Twitter being broken for a bit since I didn't mind not using it. Then I realized my Firefox battery usage had essentially doubled and was draining my battery faster than normal. Once I cleared all Twitter site data including the service worker, back to normal.

Re:Twitter preconnects to the wrong domains by raxxorrax on Tuesday October 27, 2020 @07:46AM (#24906478)
So it wasn't just my browser or my internet connection. I used CTRL + F5 in FF and it always worked, but on a normal refresh it would either display an error or the page didn't load at all.

Thought that my IP had landed on some list where Twitter degraded the connection and I wasn't even logged in.

Re:Twitter preconnects to the wrong domains by disgruntledphd2 on Tuesday October 27, 2020 @09:08AM (#24907015)
Yeah, I got loads of these - this tweet is not available to you etc.

Recently, it appears that I can't load twitter URLs with query parameters - the Guardian use some really weird ones of these, but when i delete them the URL loads. Super weird.

Re:Twitter preconnects to the wrong domains by Isthatablackgsd on Tuesday October 27, 2020 @10:51AM (#24907961)
I am relieved that I am not the only one. I thought it was something to do with my phone, the browser I am using or something else.

Happy to know that Twitter is just being Twitter.

Re:Twitter preconnects to the wrong domains by saagarjha on Tuesday October 27, 2020 @07:06AM (#24906220)
In Safari it will just drop you to an error page 70% of the time you navigate to it through a link, I assume because it doesn’t get its tasty tracking data. You have to reload the page to get anything to show up.
Re:Twitter preconnects to the wrong domains by d3nj4l on Tuesday October 27, 2020 @07:33AM (#24906403)
On FF on Linux and Android it shows me that error message 100% of the time. Refreshing gets it to load.
Re:Twitter preconnects to the wrong domains by R0b0t1 on Tuesday October 27, 2020 @10:25AM (#24907703)
Same here, now refreshing typically doesn't work.
Re:Twitter preconnects to the wrong domains by pram on Tuesday October 27, 2020 @02:49PM (#24910527)
Yes I get this too, for a long time. I’m constantly shocked that a major platform could be so fundamentally broken for so long lol
Re:Twitter preconnects to the wrong domains by Macha on Tuesday October 27, 2020 @09:22AM (#24907122)
This has been my experience on mobile twitter for years, and in the last year on the desktop one as well. I thought it was a passive aggressive push for users to log in or install the official apps.
Re:Twitter preconnects to the wrong domains by marcosdumay on Tuesday October 27, 2020 @09:38AM (#24907275)
I have just gave up on clicking on any Twitter link. I guesses a log in was required now.
Re:Twitter preconnects to the wrong domains by thespoonbends on Tuesday October 27, 2020 @09:24AM (#24907148)
+1. I figured it was anti-abuse.
Re:Twitter preconnects to the wrong domains by oauea on Tuesday October 27, 2020 @07:38AM (#24906435)
This has been happening for at least a year for me in Firefox. 100% of the time. It's rather odd.
Re:Twitter preconnects to the wrong domains by megous on Tuesday October 27, 2020 @07:53AM (#24906523)
Me too. First follow from external website to previously unvisited tweet, there's an error. If I open it again it works, and keeps working from then on. Also happening 100% of the time on new tweets.

Kinda funny that twitter can't figure out such basics such as opening a page correctly when following a link. This has been happening for months.

Web development is hard.

Re:Twitter preconnects to the wrong domains by splaytreemap on Tuesday October 27, 2020 @11:40AM (#24908466)
Loading a tweet really isn't that hard; it's just Twitter's engineering team is incompetent. Even tiny little websites that custom-roll their own forums have less trouble loading their content than Twitter.
Re:Twitter preconnects to the wrong domains by whylo on Tuesday October 27, 2020 @08:30AM (#24906750)
Yep, same. I used to get a message saying I'd been rate-limited, now I just get a generic error.
Re:Twitter preconnects to the wrong domains by fidelramos on Tuesday October 27, 2020 @03:45PM (#24911019)
I have the theory that they do this on purpose so more people opt to install their mobile apps, to which I strongly refuse.
Re:Twitter preconnects to the wrong domains by userbinator on Tuesday October 27, 2020 @09:33AM (#24907216)
I don't use Twitter except when I'm linked to it and for occasional searches, and it's been a huge step backwards with the new UI that was forced on everyone a few months ago. It even has a loading screen because it's much slower, and somehow also manages to show less content than the previous design.

If I remember correctly there was a brief period a while ago when they did use a JS-only "web app", but then switched back to simple HTML with JS enhancements (and I seem to remember they announced that change with much pride).

Of course, there is always mobile.twitter.com that is still static-only and quite usable without JS, but IMHO Twitter is the perfect example of how the "modern web" is doing less with more.

Re:Twitter preconnects to the wrong domains by miffe on Tuesday October 27, 2020 @07:42AM (#24906462)
Go to about:serviceworkers and ctrl-f twitter and remove every instance. That will fix it.
Re:Twitter preconnects to the wrong domains by dTal on Tuesday October 27, 2020 @10:24AM (#24907700)
TIL about service workers.

So there's a persistent cache of javascript that can't be cleared except one at a time? My cache is full of fly-by-night websites. Surely this is a shocking privacy hole?

Web browsers need to be more transparent about what state they are storing, and more accommodating of attempts to clear it.

Re:Twitter preconnects to the wrong domains by kalleboo on Tuesday October 27, 2020 @10:35AM (#24907823)
> Surely this is a shocking privacy hole?

Also a performance/battery suck. Apple refuses to implement it in Safari, and it's one of the big reasons web developers deride Safari for being "the new IE"

Re:Twitter preconnects to the wrong domains by detaro on Tuesday October 27, 2020 @11:10AM (#24908153)
> Also a performance/battery suck

That's far from obvious. Good cache control and offline usage are great for battery usage.

> Apple refuses to implement it in Safari

Wrong, Safari supports them. What Apple doesn't do well is enabling webapps that you pin to your homescreen ("PWAs") to work (they allow it, but from what I hear it's buggy and has weird restrictions), because they'd rather force you to make a native app.

Re:Twitter preconnects to the wrong domains by account42 on Tuesday November 03, 2020 @05:35AM (#24978292)
You can have good cache control with HTTP headers, no need to run scripts on the client for that.
Re:Twitter preconnects to the wrong domains by GoblinSlayer on Tuesday October 27, 2020 @11:07AM (#24908126)
As I understand the docs, they can be killed any time, e.g. when their site is left, then they aren't different from page scripts. Well, it doesn't look like they solve any problem either.
Re:Twitter preconnects to the wrong domains by detaro on Tuesday October 27, 2020 @11:21AM (#24908255)
The most crucial thing they solve is giving websites access to their cached pages, and they can thus show cached content while also making a request for new data in the background, still provide cached functionality while the device isn't connected to the internet, ...

In the wider concept of "PWA" (Progressive Web Apps), they also are used to enable webapps to act a bit like local apps if the user opts in - a user can add them to the homescreen, and they then are launched just like normal apps (but still sandboxed in the browser). An example that does this quite well is the Web-IRC client "The Lounge" - you can open and use it in the browser, but also pin it as a standalone app, including support for push notifications etc if you allow that.

Re:Twitter preconnects to the wrong domains by dTal on Tuesday October 27, 2020 @06:40PM (#24912873)
Well, except there's nothing stopping a site from handing out a unique service worker with a hard-coded i.d. to every visitor. It's persistent state with behaviour, like a cookie that can do things.
Re:Twitter preconnects to the wrong domains by Isthatablackgsd on Tuesday October 27, 2020 @11:21AM (#24908254)
Me as well, I look up about service workers.

I agree with the transparency, I was not aware about service workers until this post. In the meantime, there are Firefox/Chrome extensions that manages the service workers. Those extension can block service workers from installing without the user consent which that was nice.

Re:Twitter preconnects to the wrong domains by wasmitnetzen on Tuesday October 27, 2020 @12:02PM (#24908735)
The Cookie AutoDelete extension has an option to delete them. I'd highly recommend having that extension anyway!
Re:Twitter preconnects to the wrong domains by gruez on Tuesday October 27, 2020 @11:05AM (#24908103)
>Surely this is a shocking privacy hole?

AFAIK it's fine because they get cleared when you delete cookies/site data, so it's no worse than a site using localstorage, for instance.

Re:Twitter preconnects to the wrong domains by untog on Tuesday October 27, 2020 @08:11AM (#24906632)
It doesn’t answer how Twitter can be so bad at this, though. Looks like a like of us have experienced this for a long time, I’m mystified why they wouldn’t fix the bug.
Re:Twitter preconnects to the wrong domains by matsemann on Tuesday October 27, 2020 @07:45AM (#24906473)
Yup, that fixed it for a few days at least last time. The issue about the whole page being inaccessible. The issue with the page loading but not the tweet is still ever present..
Re:Twitter preconnects to the wrong domains by abstractbarista on Tuesday October 27, 2020 @11:27AM (#24908316)
Wow, I guess this is common. This has happened to me for months using Chrome on Ubuntu with UBlock & Privacy Badger. I always assumed it was the extensions but I guess not.

Twitter is literally so buggy. Most of the time I have to refresh a page several times. Maybe it's because I don't have an account and refuse to use their apps?

Re:Twitter preconnects to the wrong domains by Vvector on Tuesday October 27, 2020 @08:26AM (#24906727)
I've seen similar issues. Who knew it was so hard to display 280 characters?
Re:Twitter preconnects to the wrong domains by djhworld on Tuesday October 27, 2020 @11:22AM (#24908271)
I've been experiencing something similar, every time I click on a twitter link from outside of Twitter, Firefox errors with "There has been a protocol violation" error and a hard refresh fixes it.

I'm not sure whether it's because I've setup FF containers to open all twitter.com links in a separate container.

Re:Twitter preconnects to the wrong domains by nyanpasu64 on Tuesday October 27, 2020 @11:53AM (#24908630)
You can stop the error by clearing Twitter cookies.

Or as @miffe said, "Go to about:serviceworkers and ctrl-f twitter and remove every instance. That will fix it."

Re:Twitter preconnects to the wrong domains by httpsterio on Tuesday October 27, 2020 @11:17AM (#24908218)
Service workers are hard to get right and if they've for example updated the service worker, it might be damn near impossible to unregister the old one and installing the newer one before the old worker is set to be cleared from the cache.
Re:Twitter preconnects to the wrong domains by ShellfishMeme on Tuesday October 27, 2020 @06:57PM (#24913024)
Reminds me of an awesome talk at jsconf a while ago.

Outbreak: index-sw-9a4c43b4b4778e7d1ca619eaaf5ac1db.js https://youtu.be/CPP9ew4Co0M

Re:Twitter preconnects to the wrong domains by wazoox on Tuesday October 27, 2020 @09:03AM (#24906970)
I switched to using nitter.net for all links to twitter. At least this trick works.
Re:Twitter preconnects to the wrong domains by imperialdrive on Wednesday October 28, 2020 @12:56AM (#24915390)
No freakin way... this whole month I thought twitter was broken... I figured it was some censorship related filter. Every visit (for me at least) requires a reload to work properly.
Re:Twitter preconnects to the wrong domains by slickrick216 on Tuesday October 27, 2020 @09:48AM (#24907373)
I’ve noticed something weird moving between hacker news and Twitter safari on my iPhone 7. If I first visit Twitter then in the same tab go to hacker news. The favicon is the Twitter one but the tab says hacker news. This doesn’t work with other sites like google that I tested. It’s quite odd. It’s like the favicon for Twitter overrides the hacker news one for the first page load
Re:Twitter preconnects to the wrong domains by saagarjha on Tuesday October 27, 2020 @06:27PM (#24912763)
My iPad does this except the icon is TechCrunch's. Not sure why.
Re:Twitter preconnects to the wrong domains by Semaphor on Tuesday October 27, 2020 @10:55AM (#24907999)
Oh, so it’s not my browser being weird, thanks :) I have to refresh every tweet I load unless it’s opened within a few seconds of the first.
Re:Twitter preconnects to the wrong domains by Kye on Tuesday October 27, 2020 @08:37AM (#24906793)
I see this a lot in Safari on iOS. I don't think it's happened in Firefox yet. Which is weird because it uses Safari on iOS.
Re:Twitter preconnects to the wrong domains by floatingatoll on Tuesday October 27, 2020 @12:48PM (#24909214)
It's been like that for me for the past full year on iOS Safari. Surprised to hear it's reached Android!
Re:Twitter preconnects to the wrong domains by Machado117 on Tuesday October 27, 2020 @10:27AM (#24907728)
This also happens to me. I just assumed that it was a dark pattern because I don’t have an account.
Re:Twitter preconnects to the wrong domains by TimSchumann on Tuesday October 27, 2020 @09:27AM (#24907172)
Been having this exact same experience for weeks, maybe months. Desktop on two OS’s and mobile.
Re:Twitter preconnects to the wrong domains by donalhunt on Tuesday October 27, 2020 @11:29AM (#24908333)
I had seen it a lot with the android client (I'm on the beta channel so I've probably been experiencing it longer than most). Glad it wasn't just me.

Kudos to the OP for investigating and documenting their findings.

@Twitter: please fix! kthxbai

Re:Twitter preconnects to the wrong domains by curiousllama on Tuesday October 27, 2020 @10:03AM (#24907497)
There are some websites that I just accept only work 60-70% of the time for me; Twitter is one
Re:Twitter preconnects to the wrong domains by vaccinator on Tuesday October 27, 2020 @10:09AM (#24907558)
It used to be the case for reddit too but they appear to have sorted most of the issues.
Re:Twitter preconnects to the wrong domains by driverdan on Tuesday October 27, 2020 @10:20AM (#24907663)
I have the same issue with Firefox on MacOS. 3rd party cookies disabled, privacy protection on, uBlock Origin, and PiHole. I assume it's a poorly handled call to a tracking or ad domain that fails, blowing it up.
Re:Twitter preconnects to the wrong domains by GhostVII on Tuesday October 27, 2020 @09:00AM (#24906952)
Oh I assumed that was intentional, to make you sign up for an account or something. I get it almost every time, opening in incogneto helps.
Re:Twitter preconnects to the wrong domains by dragonsngoblins on Tuesday October 27, 2020 @07:06PM (#24913104)
The issue on Android also happens for me. I honestly assumed it was a deliberate dark pattern to encourage installing the app
Re:Twitter preconnects to the wrong domains by Taylor_OD on Tuesday October 27, 2020 @01:58PM (#24910017)
I get the same thing on my android. I always wonder how an issue like that can go on for years with no fix.
Re:Twitter preconnects to the wrong domains by nukemandan on Tuesday October 27, 2020 @01:17PM (#24909520)
This, for me, was due to an expired cookie. You need to clear the cookies and local storage and log ba in to fix.

Not ideal

Re:Twitter preconnects to the wrong domains by chowned on Tuesday October 27, 2020 @09:52AM (#24907408)
I have to refresh the page once or twice when attempting to load a tweet in Safari or Chrome on iOS, otherwise I usually get a cryptic "this tweet is not available to you" message or something similar. I also just assumed it was a dark pattern to get me to use the app.