Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Conversation

@rkohrt
Copy link

@rkohrt rkohrt commented Feb 4, 2018

let KeepAliveSender detect if the websocket is no longer alive and trigger recreation of SignalServiceMessagePipe - fixes signalapp/Signal-Android#6447 for non GCM devices

By not checking for the response of the keep alive message it is not detected when the device goes from mobile -> WiFi or vice versa. Thus we keep sending the keep alive message to a broken pipe over and over for no reason. While we will not get push messages from the server, because we do not have a working active connection to it. I fixed the problem by listening for 30seconds to the future (line 298) created by sending the keep alive message and if we do not get a response within these 30 seconds, the connection is killed -> WebSocketConnection.client = null -> WebSocketConnection.readRequest will throw IOException("Connection closed!") -> SignalServiceMessageReceiver.MessageRetrievalThread.run will catch it and create a new SignalServiceMessagePipe utilizing the new network and we keep subscribed for push messages :-)

…r recreation of SignalServiceMessagePipe - fixes #6447
@rkohrt
Copy link
Author

rkohrt commented Aug 26, 2018

Any comments on this one? I don't think I am the only one that has problems with this bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to receive push messages after switching network type

1 participant