fix(android): retain action layer and idle rotation across turns
This commit is contained in:
@@ -82,7 +82,7 @@ fun runChecks() {
|
||||
event("auth"); check(socket.sent.size == 1)
|
||||
event("hello")
|
||||
check(statuses == listOf(ConnectionStatus.CONNECTED))
|
||||
check(logs.filterNot { it.startsWith("listen ") || it.startsWith("ws control skipped") } == listOf("ws open", "auth ok", "hello sent", "hello received"))
|
||||
check(logs.filterNot { it.startsWith("listen ") || it.startsWith("ws control skipped") } == listOf("ws open", "auth ok", "hello sent action_offer=none generation=0", "hello received action_pack=unknown generation=0"))
|
||||
check(client.listen(true))
|
||||
event("hello"); check(statuses.count { it == ConnectionStatus.CONNECTED } == 1)
|
||||
event("history"); check(events.last() == EventKind.HISTORY)
|
||||
@@ -96,9 +96,18 @@ fun runChecks() {
|
||||
Handler.drain()
|
||||
check(socket.sent == listOf("hello"))
|
||||
check(statuses == listOf(ConnectionStatus.CONNECTED))
|
||||
check(logs == listOf("auth ok", "hello sent", "ws open", "hello received"))
|
||||
check(logs == listOf("auth ok", "hello sent action_offer=none generation=0", "ws open", "hello received action_pack=unknown generation=0"))
|
||||
close()
|
||||
}
|
||||
for((hello,expected) in listOf("hello" to "unknown","hello available" to "accepted","hello unavailable" to "unavailable")) {
|
||||
Fixture().apply {
|
||||
event("auth");event(hello);check(client.actionNegotiation==expected)
|
||||
// Old-generation HELLO cannot overwrite the negotiated connection.
|
||||
client.callbacks(-1).onMessage(socket,"hello unavailable");Handler.drain()
|
||||
check(client.actionNegotiation==expected)
|
||||
close();check(client.actionNegotiation=="disconnected")
|
||||
}
|
||||
}
|
||||
Fixture().apply {
|
||||
event("hello"); check(statuses.isEmpty() && !client.listen(true))
|
||||
handshake(); check(statuses.last() == ConnectionStatus.CONNECTED)
|
||||
@@ -243,7 +252,7 @@ fun runChecks() {
|
||||
check(states.last().connection == ConnectionStatus.CONNECTING)
|
||||
cb.onMessage(current, "hello"); Handler.drain()
|
||||
check(states.last().connection == ConnectionStatus.CONNECTED)
|
||||
check(listOf("auth ok", "hello sent", "hello received").all { it in logs })
|
||||
check(listOf("auth ok", "hello sent action_offer=none generation=1", "hello received action_pack=unknown generation=1").all { it in logs })
|
||||
session.startVoice()
|
||||
session.background(showDisconnectReason = true)
|
||||
check(states.last().connection == ConnectionStatus.DISCONNECTED && !states.last().voiceActive)
|
||||
@@ -471,7 +480,7 @@ fun runChecks() {
|
||||
session.release(); barrier.countDown(); Handler.drain()
|
||||
}
|
||||
check(DebugLogUpload.records.any { it.first == "connect" && it.second.startsWith("state=connected reason=") })
|
||||
check(DebugLogUpload.records.any { it == "auth" to "hello received" })
|
||||
check(DebugLogUpload.records.any { it == "auth" to "hello received action_pack=unknown generation=0" })
|
||||
check(DebugLogUpload.records.any { it == "ws" to "ws event=history" })
|
||||
check(DebugLogUpload.records.none { (_, message) -> "auth_ready" in message })
|
||||
check(DebugLogUpload.records.any { (_, message) -> "finish reason=control_send_failure stack=" in message })
|
||||
|
||||
Reference in New Issue
Block a user