Skip to content

feat: send push notifications on VPN failures - #266

Merged
ethanndickson merged 3 commits into
ethan/notification-categoriesfrom
ethan/vpn-failure-notifications
Sep 9, 2026
Merged

feat: send push notifications on VPN failures#266
ethanndickson merged 3 commits into
ethan/notification-categoriesfrom
ethan/vpn-failure-notifications

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Sep 8, 2026

Copy link
Copy Markdown
Member

Relates to #195. Supersedes #196.

When Coder Connect enters a failed state, the app now sends a push notification with the same error message that the menu shows. Clicking the notification opens the menu.

CoderVPNService exposes an onFailure callback next to the existing onStart. It fires on each transition of tunnelState, neState, or sysExtnState into their .failed case, so tunnel errors, network extension errors, and system extension errors all notify. Pending approval and unconfigured states are not failures and stay silent. AppDelegate wires the callback to sendNotification, so the service stays free of UI code.

Relates to #195. Supersedes #196.

When Coder Connect enters a failed state, the app now sends a push notification with the same error message that the menu shows. Clicking the notification opens the menu.

`CoderVPNService` exposes an `onFailure` callback next to the existing `onStart`, fired from `tunnelState.didSet` on each transition into `.failed`. `AppDelegate` wires it to `sendNotification`, so the service stays free of UI code.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T02:37:52.345366Z 2d33e77 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d6d74a07f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Coder-Desktop/Coder-Desktop/VPN/VPNService.swift Outdated
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3dd2858cf3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Coder-Desktop/Coder-Desktop/VPN/VPNService.swift Outdated
The tunnel reports .invalid while an existing configuration is removed on login, logout, or reconfiguration. The views treat the resulting .unconfigured state as a prompt, not an error, so it should not notify.
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d33e7764e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Coder-Desktop/Coder-Desktop/Notifications.swift
@ethanndickson

Copy link
Copy Markdown
Member Author

@codex review

re: Avoid hiding an already-visible menu

menuBarExtra.isVisible reports whether the status bar icon is visible (it checks the status item button's occlusion), not whether the menu window is open, so it can't be used as a guard here. The menu window dismisses itself on windowDidResignKey, and clicking a notification banner takes key status away from it, so by the time this handler runs the menu is already closing. Guarding on window visibility would need a new API in our fluid-menu-bar-extra fork; not worth it for this edge case.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2d33e7764e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ethanndickson
ethanndickson merged commit ce2d4a4 into main Sep 9, 2026
5 of 6 checks passed
@ethanndickson
ethanndickson deleted the ethan/vpn-failure-notifications branch September 9, 2026 02:21
@matifali

matifali commented Sep 9, 2026

Copy link
Copy Markdown
Member

Let's bump a minor version when this gets released.

@ethanndickson

Copy link
Copy Markdown
Member Author

Let's bump a minor version when this gets released.

I'm waiting on a fix for #264 (see my comment) but yep will do

@ethanndickson

Copy link
Copy Markdown
Member Author

@matifali we have mutagen version bump(s) incoming, so I'm gonna wait for those too

Copy link
Copy Markdown
Member

Yes all good. Not asking for a release. Whenever we do.

@linear-code

linear-code Bot commented Sep 10, 2026

Copy link
Copy Markdown

ENG-3333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants