tigase / beagle-im

(M) XMPP client for macOS based on TigaseSwift XMPP library
GNU General Public License v3.0
181 stars 21 forks source link

Better handle connectivity loss #142

Open truenicoco opened 1 year ago

truenicoco commented 1 year ago

Is your feature request related to a problem? Please describe. When using an intermittent wifi, eg, the wifi on the train, which often loses connectivity, beagle seems to "not notice" that the connection to the XMPP server has been lost, resulting in no more incoming messages.

Describe the solution you'd like Beagle should use one of the xeps dedicated to verifying that the connection is still active (ping? stream management? I'm no expert), used by mobile clients, to detect when the connection has been lost and attempt reconnection.

Describe alternatives you've considered The workaround when it happens is to restart beagle or disable/enable the accounts. This is not really satisfying as it may take a while to notice that beagle is in this broken state, resulting in fights with my wife.

hantu85 commented 1 year ago

Beagle uses internally network connectivity detection framework provided by Apple that should detect disconnection and automatically reconnect.

However, due to described issue, I do think that the issue is not with your connection to your wifi (that would be detected by macOS and Apple framework), but with the router providing internet connection to the wifi that you are using. Due to that, failed connection is a lot harder to detect.

As for possible solutions, we already have support for Stream Management and ping should also be supported. Right now we are in the middle of preparations for a new version that would contain a lot of changes internally and should also improve connectivity detection.

I'm leaving this issue open to verify on the new version of the app (before it will be released) that it contains ping support and that is properly works.

truenicoco commented 1 year ago

Yes, I described it poor. Indeed, the wifi connection stays on, but the internet is intermittently (un)reachable. I don't take the train that often but I guess I can reproduce at home by unplugging/replugging the optic fiber from my home router for tests. :)