mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-24 02:33:00 +01:00
Add fix + regression test for null disconnectReason in onConnectionInterrupted.
This commit is contained in:
committed by
Greyson Parrelli
parent
bce4c347a1
commit
22bfafc317
+1
-1
@@ -379,7 +379,7 @@ class LibSignalChatConnection(
|
||||
incomingRequestQueue.put(incomingWebSocketRequest)
|
||||
}
|
||||
|
||||
override fun onConnectionInterrupted(chat: ChatConnection, disconnectReason: ChatServiceException) {
|
||||
override fun onConnectionInterrupted(chat: ChatConnection, disconnectReason: ChatServiceException?) {
|
||||
CHAT_SERVICE_LOCK.withLock {
|
||||
Log.i(TAG, "$name connection interrupted", disconnectReason)
|
||||
chatConnection = null
|
||||
|
||||
+6
@@ -69,6 +69,12 @@ class LibSignalChatConnectionTest {
|
||||
delay {
|
||||
it.complete(null)
|
||||
disconnectLatch?.countDown()
|
||||
|
||||
// The disconnectReason is null when the disconnect is due to the local client requesting the disconnect.
|
||||
// This is a regression test because we previously forgot to update the Kotlin type definitions to
|
||||
// match this when the behavior changed in libsignal-client, causing NullPointerExceptions
|
||||
// missed connection interrupted events.
|
||||
chatListener!!.onConnectionInterrupted(chatConnection, null)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user