communi / communi-sailfish

The first and foremost IRC client for Sailfish OS
BSD 3-Clause "New" or "Revised" License
38 stars 18 forks source link

[BUG] Network connection is stuck when network connection is changed #116

Open Mikaela opened 9 years ago

Mikaela commented 9 years ago

I am not sure how to explain this. When I change from mobile data to WLAN, Communi Sailfish thinks that the connection stays open, but doesn't send or receive any messages. Same when changing from WLAN to mobile data or another WLAN.

I think that currently the only way to make Communi Sailfish connect over network change is to (when mobin from mobile data --> wlan) disable both mobile data and WLAN and then re-enable WLAN. Sometimes the WLAN also dies with the same symptoms, no messages sent or received, I mostly see this in buses.

Mikaela commented 9 years ago

Original issue description from IRC:

2015-05-18.log:[23:18:00] Sailfish version also has some kind of trouble with detecting when I move to WLAN or when WLAN loses conenction, in both cases it thinks it's connected forever and I must restart or move to mobile broadband so it reconnects

Venemo commented 9 years ago

You don't need to restart. It is enough to long-press the network in the left pulley and disconnect / reconnect.

However it really should reconnect automatically.

Mikaela commented 8 years ago

Is there any ETA when this might get fixed and got to Jolla Store?

This is just still the only reason why I use mobile network everyhwhere instead of WLAN while there are a lot of WLANs I could connect to often with better connectivity.

zenkuro commented 4 years ago

I can try to fix this. Can anybody from the team supervise me?

Thaodan commented 3 years ago

Is that still the case? I just tried this by switching from mobile data to wlan and everything is fine.

Venemo commented 3 years ago

It's supposed to work, but many times it's unreliable. As we discussed on IRC, sometimes it just gives up and doesn't reconnect. I never quite figured out why, but it happened rarely enough that it never bothered me that much.

Thaodan commented 3 years ago

I think I've found the reason for the issue:

  1. First connect to your device via ssh over USB Network.
  2. export IRC_DEBUG=4
  3. run harbour-communi 3 Now disconnect and connect your internet connection multiple times, it does not matter if it switching from Wifi to Mobile Data just make it reconnect
  4. Then try to send a message.
  5. The message looks like its send from the UI side at first but in chat there is no message and there is still the message about the message from the debug log from the client side but is no response from the server. After a time the client properly connects after QAbstractSocket::NetworkError occurs.
[D] unknown:0 - [2021-10-19T19:40:20 OFTC@Bnc] -> "PRIVMSG OFTC@Bnc :jsjwwj"
[D] unknown:0 - [2021-10-19T19:40:27 OFTC@Bnc] -> "PRIVMSG OFTC@Bnc :jsjsjse"
[D] unknown:0 - [2021-10-19T19:41:47 Bitlbee@Bnc] -> "PRIVMSG &bitlbee :jsjsjss"
[D] unknown:0 - [2021-10-19T19:43:55 OFTC@Bnc] !! QAbstractSocket::NetworkError
[D] unknown:0 - [2021-10-19T19:43:55 OFTC@Bnc] ?? Error bnc..de 6697
[D] unknown:0 - [2021-10-19T19:43:55 OFTC@Bnc] ?? Waiting bnc..de 6697
[D] unknown:0 - [2021-10-19T19:44:10 OFTC@Bnc] ?? Connecting bnc..de 6697
Venemo commented 3 years ago

Nice work, so the issue is that it takes too long before a NetworkError is handled?

Thaodan commented 3 years ago

I think so far that the NetworkConfiguration state isn't updated properly inside Qt.

mornfall commented 2 years ago

(If anyone still cares about this, a fix/workaround can be found here: https://github.com/communi/communi-sailfish/compare/master...mornfall:communi-sailfish:master)

Thaodan commented 2 years ago

mornfall 1 month ago (If anyone still cares about this, a fix/workaround can be found here: https://github.com/communi/communi-sailfish/compare/master...mornfall:communi-sailfish:master)

Well I do care about it but it would be faster to get to it for me if you would follow the proceedings. It does you time and me.

I will try to add some instructions on how and why. But for now please just create a branch and than create a PR with that branch.

Thaodan commented 6 months ago

I've have been testing the fix/new feature for this bug. It does look very good so far.

Thanks @mornfall.