feathersjs/feathers-chat

Socket connection timed out (Chrome 65 Android)

jakobvogt opened this issue · 3 comments

Hello,
I have now used Feathers for several projects and I really like it (keep it up!). But the other day I noticed a weird bug when testing my app on my Android device. So I checked if my other applications would have the same bug. It turned out that all apps which used socket connections were affected. To really make sure that it wasn't my fault I used the official feathers-chat server and the react client... it also had the same issue.

Bug:

Uncaught (in promise) Error: Socket connection timed out at setTimeout (passport.js:120)
The Bug only occurs on the Android Chrome browser when you're already logged in and reload the page but only approx. 20% of the time (but it varies quite heavily).
I tested Firefox, Opera, Edge and Chrome on Desktop and they all work fine. I had an old Chrome Beta version on my phone (59) and there it also worked. Chrome 65, 66 and 67 all don't work. (devices tested on: Oneplus 3T 8.0, LG G6 7.0, Moto X Play 7.1.1)
Another strange thing: The bug disappears on all Chrome versions if you turn on "Data Saver".

Steps to reproduce:

  • Clone this repo + any client
  • Run both
  • Visit with Chrome 65 on your Android device (data saver turned off!)
  • Create an account and log in
  • Reload a couple times until the timeout occurs (it will show "Loading" for 5s and then redirect to login)

Would be glad if you could help me out somehow or just try to reproduce it.
It's probably just a bug (a pretty weird one) with Chrome but its still pretty annoying when you keep in mind that 30% of all visitors are using it.
If you have any questions or something wasn't clear, please don't hesitate to ask :)

daffl commented

Can you try if it works with the non-standard configuration, e.g. forcing the websocket transport?

const socket = io('http://api.my-feathers-server.com', {
  transports: ['websocket']
});

That fixed it, now it works every time. Thank you!
Is there any downside to this configuration (because it's 'non-standard')?

daffl commented

Probably not anymore but it depends on what browsers you have to support. Websockets are supported in all modern browsers.