Skip to content

Commit 3172ac2

Browse files
committed
feat: send push notifications on VPN failures
1 parent c19b39a commit 3172ac2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Coder-Desktop/Coder-Desktop/VPN/VPNService.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ final class CoderVPNService: NSObject, VPNService {
6161
if tunnelState == .connecting {
6262
progress = .init(stage: .initial, downloadProgress: nil)
6363
}
64+
if case let .failed(tunnelError) = tunnelState, tunnelState != oldValue {
65+
Task {
66+
do {
67+
try await sendNotification(title: "Coder Connect has failed!", body: tunnelError.description)
68+
} catch let notifError {
69+
logger.error("Failed to send notification (\(tunnelError.description)): \(notifError)")
70+
}
71+
}
72+
}
6473
}
6574
}
6675

0 commit comments

Comments
 (0)