-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to receive push messages after switching network type #6447
Unable to receive push messages after switching network type #6447
Comments
A workaround is restarting the service whenever you switch network type, by using the following adb commands: I run these commands using tasker whenever mobile network is connected or disconnected. They need to be run as root. |
Just thought I would add that I had the same issue when trying to use signal without GCM. The messages would come through whenever I opened up Signal itself though, but never otherwise, unless I hadn't switched network since the device was last booted, or since signal was last quit and reopened. That was on a OP3T running LineageOS first April nightly, rooted and with microG installed (but Signal not registered with GCM). |
I am having the same problem on Websocket version 4.13.7. Switching back to the original network (WiFi, 4G) doesn't restore the connection, but I find that I can still send outbound messages - they only get 'one tick' next to them as in it isn't confirmed as received on the desitnation end, but they do receive it. I do not receive a response until killing the app and reopening, then I get this (excerpt before/during/after killing app):
Full debug: |
I believe @dpapavas was working on a fix, maybe he can give an update? Btw, I think this issue and #6644 are the same. |
I'm not sure if this bug is related to #6644, or not, but I do remember looking into it as part of the bug. I'm a bit hazy on the details though, but I can confirm that it can be fixed, if not fully, at least to a large degree. One line of reasoning is that, just as the keep-alive thread blocks forever due to reasons explained in #6644, so does the loop that creates, tries to read from and then destroys the message pipe. The upshot is that, if the network changes, the current pipe's connection is broken, but it's stuck in blocking sleep, so a new one isn't created until it happens to wake up. That wouldn't explain why the device is able to send messages though, so the issue must be a bit more complex. I see that my patched version (see 2c02f8f#diff-9c046c6a5dc41570be2a81403504b78d), keeps track of several pipes, so the problem is probably that, while a new connection is generated, the message retrieval thread is blocked and stuck listening to the old connection, where the server will never respond with a receipt. It still uses the new pipe to send messages though, so that works. I think the issue is further compounded, at least on some devices, mine being one of them, by the fact that it can take a lot of time (I've measured 20 minutes, if memory serves) from the time the connection is broken, until the socket (or the library handling them) signals that fact, causing a new connection to be generated. I remember trying to detect a change in the network connection of the device, trying to force a reconnection, but I can't find any of that code, so I assume it didn't work out. As to a fix, I'm afraid I'm not working on an official fix, for reasons I've explained in signalapp/libsignal-service-java#45. I have resolved to keep my private patched version, until further notice, where I can confirm that this problem is mostly solved. (I say mostly, because I still occasionally get a missed call notification, even though the device is just sitting on the table, so that it shouldn't have any reason to have connection problems). The patched version has a further fix concerning #6258 and it also has the update nag notification disabled, for obvious reasons. I update it from time to time and anyone is, of course, welcome to use it. You'll need this and this. |
Same issue here, websockets won't time out when switching network connection, and signal doesnt receive any messages for a long time... |
I forgot to update here, that my assumption was wrong. I did have a fix that, which I had included in my private version, and which I recently improved and commited (4359b4f). More details can be found in my post here. |
GitHub Issue Cleanup: |
I have:
Bug description
Whenever I switch network type (from WiFi to 3G/LTE or vice versa), Signal is unable to receive any push messages. This includes normal messages and also received confirmation (the double check mark). I am however able to send messages (single check mark) and they are also received. Switching back from mobile network to WiFi also does not solve the problem. After reinstalling Signal the bug still persists.
Important: This phone does not have GCM. It appears the websocket pipe gets broken.
Steps to reproduce
Actual result: Switching to mobile network causes Signal to not receive any push messages
Expected result: Signal is able to handle the network switch and is able to receive both messages and received confirmations.
Device info
Device: Samsung Galaxy S4
Android version: 7.1.1
Signal version: 4.1.0
Link to debug log
https://gist.github.com/timotk/bad33a0bff9129358938cd2c4f568ada
I believe this is the relevant part:
The text was updated successfully, but these errors were encountered: