-
Notifications
You must be signed in to change notification settings - Fork 5
feat: send push notifications on VPN failures #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3172ac2 to
4a6433a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds user-facing push notifications when the VPN or URI handler fails, and refactors notification setup and handling into the AppDelegate.
- Bumps the
fluid-menu-bar-extradependency revision. - Sends a
.vpnFailurenotification on VPN state failures. - Refactors
UNUserNotificationCenterdelegate logic intoAppDelegate, registers categories, and updatessendNotification.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Coder-Desktop/project.yml | Updated fluid-menu-bar-extra revision |
| Coder-Desktop/Coder-Desktop/VPN/VPNService.swift | Send push notification on VPN failures |
| Coder-Desktop/Coder-Desktop/Notifications.swift | Moved delegate into AppDelegate, added categories and NotificationCategory enum, updated sendNotification signature |
| Coder-Desktop/Coder-Desktop/Coder_DesktopApp.swift | Call new category registration, set delegate to self, update URI failure call |
| @@ -1,8 +1,23 @@ | |||
| import UserNotifications | |||
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old NotifDelegate class was removed but I don’t see its full definition cleaned up. Please remove any leftover NotifDelegate declaration to avoid dead code.
| nonisolated func userNotificationCenter( | ||
| _: UNUserNotificationCenter, | ||
| willPresent _: UNNotification | ||
| ) async -> UNNotificationPresentationOptions { |
Copilot
AI
Jul 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure the userNotificationCenter(_:willPresent:withCompletionHandler:) method is inside the AppDelegate extension so banners still appear while the app is active.
|
Might come back to this later. |

Relates to #195.
When the macOS VPN unexpectedly disconnects, Coder Connect currently just displays a red error message:

Now, when this happens, we'll additionally send a push notification with the same message:

The above error message was produced by force quitting the system extension.
Clicking these VPN failure notifications also opens the tray:
notifdemo.mov
Once coder/coder#18602 is closed, we can also send push notifications when Coder Connect disconnects / attempts to dial the Coder deployment. We currently do not support being notified of these events.