From 6dfd5569b3bb05cb5f6413d6d29bf88b5586885e Mon Sep 17 00:00:00 2001 From: Eulices Lopez <105620565+eulicesl@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:28:21 -0400 Subject: [PATCH] fix(ios): harden live activity HUD cleanup and diagnostics logging --- apps/ios/Sources/Gateway/GatewaySettingsStore.swift | 9 +++------ apps/ios/Sources/Model/NodeAppModel.swift | 7 ++++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/ios/Sources/Gateway/GatewaySettingsStore.swift b/apps/ios/Sources/Gateway/GatewaySettingsStore.swift index c4aa8f0ecd6..af97f9db568 100644 --- a/apps/ios/Sources/Gateway/GatewaySettingsStore.swift +++ b/apps/ios/Sources/Gateway/GatewaySettingsStore.swift @@ -434,14 +434,11 @@ enum GatewayDiagnostics { private static let keepLogBytes: Int64 = 256 * 1024 private static let logSizeCheckEveryWrites = 50 private static let logWritesSinceCheck = OSAllocatedUnfairLock(initialState: 0) - nonisolated(unsafe) private static let isoFormatter: ISO8601DateFormatter = { - let f = ISO8601DateFormatter() - f.formatOptions = [.withInternetDateTime, .withFractionalSeconds] - return f - }() private static func isoTimestamp() -> String { - self.isoFormatter.string(from: Date()) + let formatter = ISO8601DateFormatter() + formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds] + return formatter.string(from: Date()) } private static var fileURL: URL? { diff --git a/apps/ios/Sources/Model/NodeAppModel.swift b/apps/ios/Sources/Model/NodeAppModel.swift index ef19a596af4..63f197885e1 100644 --- a/apps/ios/Sources/Model/NodeAppModel.swift +++ b/apps/ios/Sources/Model/NodeAppModel.swift @@ -1646,7 +1646,12 @@ private extension NodeAppModel { guard let autoHideSeconds else { return } self.cameraHUDDismissTask = Task { @MainActor in - try? await Task.sleep(nanoseconds: UInt64(autoHideSeconds * 1_000_000_000)) + do { + try await Task.sleep(nanoseconds: UInt64(autoHideSeconds * 1_000_000_000)) + } catch { + return + } + guard !Task.isCancelled else { return } withAnimation(.easeOut(duration: 0.25)) { self.cameraHUDText = nil self.cameraHUDKind = nil