Уведомления CarPlay, панель вложений с Lottie, фикс reply preview, плавная анимация клавиатуры, стабильность WebSocket
This commit is contained in:
@@ -323,7 +323,9 @@ final class ProtocolManager: @unchecked Sendable {
|
||||
|
||||
sendPacketDirect(handshake)
|
||||
|
||||
// Timeout
|
||||
// Timeout — force reconnect instead of permanent disconnect.
|
||||
// `client.disconnect()` sets `isManuallyClosed = true` which kills all
|
||||
// future reconnection attempts. Use `forceReconnect()` to retry.
|
||||
handshakeTimeoutTask?.cancel()
|
||||
handshakeTimeoutTask = Task { [weak self] in
|
||||
do {
|
||||
@@ -333,8 +335,13 @@ final class ProtocolManager: @unchecked Sendable {
|
||||
}
|
||||
guard let self, !Task.isCancelled else { return }
|
||||
if !self.handshakeComplete {
|
||||
Self.logger.error("Handshake timeout")
|
||||
self.client.disconnect()
|
||||
Self.logger.error("Handshake timeout — forcing reconnect")
|
||||
self.handshakeComplete = false
|
||||
self.heartbeatTask?.cancel()
|
||||
Task { @MainActor in
|
||||
self.connectionState = .connecting
|
||||
}
|
||||
self.client.forceReconnect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user