Фикс: бэкграунд звонки — аудио, имя на CallKit, deactivation order, UUID race
This commit is contained in:
@@ -243,11 +243,14 @@ final class ProtocolManager: @unchecked Sendable {
|
||||
/// Keeps the process alive during active calls so WebSocket survives brief background.
|
||||
func beginCallBackgroundTask() {
|
||||
guard callBackgroundTask == .invalid else { return }
|
||||
let remaining = UIApplication.shared.backgroundTimeRemaining
|
||||
Self.logger.info("📞 Background task starting — remaining=\(remaining, privacy: .public)s wsState=\(String(describing: self.connectionState), privacy: .public)")
|
||||
callBackgroundTask = UIApplication.shared.beginBackgroundTask(withName: "RosettaCall") { [weak self] in
|
||||
// Don't end the call here — CallKit keeps the process alive for active calls.
|
||||
// This background task only buys time for WebSocket reconnection.
|
||||
// Killing the call on expiry was causing premature call termination
|
||||
// during keyExchange phase (~30s before Desktop could respond).
|
||||
Self.logger.info("📞 Background task EXPIRED — OS reclaiming")
|
||||
self?.endCallBackgroundTask()
|
||||
}
|
||||
Self.logger.info("📞 Background task started for call")
|
||||
|
||||
Reference in New Issue
Block a user