Уведомления CarPlay, панель вложений с Lottie, фикс reply preview, плавная анимация клавиатуры, стабильность WebSocket

This commit is contained in:
2026-03-22 01:58:13 +05:00
parent 65e5991f97
commit 9289bb2efd
20 changed files with 645 additions and 172 deletions

View File

@@ -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()
}
}
}