I think I figured out why the connection gets buggy
-
When the network connection is lost, the forum switches from websockets to polling. Then, when it reconnects, it never switches back!
I'd be willing to bet that's exactly what causes the forum to get into the semi-disconnected/broken network state.
-
@sloosecannon That would explain a LOT! I wonder if that would also fix the random errors when using something like an iPad?
-
@sloosecannon said in I think I figured out why the connection gets buggy:
websockets
I think I figured out why the connection gets buggy.
-
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@sloosecannon said in I think I figured out why the connection gets buggy:
websockets
I think I figured out why the connection gets buggy.
No, that's what works. It stops working when the websockets drop.
-
@sloosecannon said in I think I figured out why the connection gets buggy:
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@sloosecannon said in I think I figured out why the connection gets buggy:
websockets
I think I figured out why the connection gets buggy.
No, that's what works. It stops working when the websockets drop.
-
@sloosecannon said in I think I figured out why the connection gets buggy:
stops working when the websockets drop.
I think I figured out why the connection gets buggy.
-
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@sloosecannon said in I think I figured out why the connection gets buggy:
stops working when the websockets drop.
I think I figured out why the connection gets buggy.
Indeed. Too bad real life exists and network interruptions happen sometimes, causing things like websockets to drop...
The bug here isn't with the network connectivity dropping, it's with it not coming back properly.
Yes I see the joke, I'm deliberately ignoring it to make a point.
:emoji:
-
@sloosecannon said in I think I figured out why the connection gets buggy:
I think
Guys, I figured out why the connection gets buggy!
-
@sloosecannon said in I think I figured out why the connection gets buggy:
broken network state.
Guys, I figured out why the connection gets buggy!
-
@sloosecannon said in I think I figured out why the connection gets buggy:
websockets
See, the joke here isn't just websockets suck. They do. But it's that we're using websockets to replace polling-- but doing it in such a way that the ONLY way for them to work properly is to re-implement polling (shittily).
Websockets is why the connection gets buggy.
-
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@sloosecannon said in I think I figured out why the connection gets buggy:
websockets
See, the joke here isn't just websockets suck. They do. But it's that we're using websockets to replace polling-- but doing it in such a way that the ONLY way for them to work properly is to re-implement polling (shittily).
Websockets is why the connection gets buggy.
The polling is a fallback if the browser has a broken implementation of websockets. Websockets are not being used for polling.
-
@ben_lubar said in I think I figured out why the connection gets buggy:
The polling is a fallback if the browser has a broken implementation of websockets. Websockets are not being used for polling.
That is exactly my point.
-
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@ben_lubar said in I think I figured out why the connection gets buggy:
The polling is a fallback if the browser has a broken implementation of websockets. Websockets are not being used for polling.
That is exactly my point.
Errr, what?
No. You're not getting what I'm saying.
The websockets work. They work fine. Except when they disconnect (probably due to something that is entirely not the fault of the websockets - networks are unreliable, things break).
When they disconnect, something, either Socket.io, or NodeBB's implementation of it, doesn't attempt to reconnect a websocket, but instead decides to fall back to the much less reliable polling method. That's probably why we're getting these network issues - when it falls back, we start seeing the problems we're seeing.
It has nothing to do with them misusing websockets, or with websockets "sucking", it has everything to do with them not properly handling error cases.
-
@ben_lubar said in I think I figured out why the connection gets buggy:
The polling is a fallback if the browser has a broken implementation of websockets
Or, like I just figured out, if the websocket disconnects at any point. They fallback to polling on network issues. Which is probably not desired behavior.
-
@sloosecannon said in I think I figured out why the connection gets buggy:
@Lorne-Kates said in I think I figured out why the connection gets buggy:
@ben_lubar said in I think I figured out why the connection gets buggy:
The polling is a fallback if the browser has a broken implementation of websockets. Websockets are not being used for polling.
That is exactly my point.
Errr, what?
No. You're not getting what I'm saying.
The websockets work. They work fine. Except when they disconnect (probably due to something that is entirely not the fault of the websockets - networks are unreliable, things break).
When they disconnect, something, either Socket.io, or NodeBB's implementation of it, doesn't attempt to reconnect a websocket, but instead decides to fall back to the much less reliable polling method. That's probably why we're getting these network issues - when it falls back, we start seeing the problems we're seeing.
It has nothing to do with them misusing websockets, or with websockets "sucking", it has everything to do with them not properly handling error cases.
Right. It should switch to polling momentarily, but as soon as websockets become available again, switch back to that.
Unless it's impossible to detect the difference between a websocket disconnected because it's not supported versus websocket disconnected through network issues...
-
Right it isn't them implementing a half-baked technology poorly, it's just them implementing a half-baked technology poorly.
-
@Lorne-Kates said in I think I figured out why the connection gets buggy:
Right it isn't them implementing a half-baked technology poorly, it's just them implementing a half-baked technology poorly.
No, it's them implementing a fully-functional technology poorly.
Or is there some magical way I don't know of to persist an active connection across a network drop?
-
@sloosecannon said in I think I figured out why the connection gets buggy:
@Lorne-Kates said in I think I figured out why the connection gets buggy:
Right it isn't them implementing a half-baked technology poorly, it's just them implementing a half-baked technology poorly.
No, it's them implementing a fully-functional technology poorly.
Or is there some magical way I don't know of to persist an active connection across a network drop?
Transparent automatic reconnection (with state-change notification)?