Skip to content

chore: append bundle version to mach service name #191

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

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Coder-Desktop/Coder-Desktop/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
<key>NetworkExtension</key>
<dict>
<key>NEMachServiceName</key>
<string>$(TeamIdentifierPrefix)com.coder.Coder-Desktop.VPN</string>
<!-- We append the CFBundleVersion to the service name to ensure a new
service is used for each version. This works around the issue described
in https://github.com/coder/coder-desktop-macos/issues/121, presumably
caused by the XPC service cache not being invalidated on update.
-->
<string>$(TeamIdentifierPrefix)com.coder.Coder-Desktop.VPN.$(CURRENT_PROJECT_VERSION)</string>
</dict>
<key>SUPublicEDKey</key>
<string>Ae2oQLTcx89/a73XrpOt+IVvqdo+fMTjo3UKEm77VdA=</string>
Expand Down
5 changes: 3 additions & 2 deletions Coder-Desktop/Coder-Desktop/VPN/VPNSystemExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,16 @@ class SystemExtensionDelegate<AsyncDelegate: SystemExtensionAsyncRecorder>:
if existing.bundleVersion == `extension`.bundleVersion {
return .replace
}
// TODO: Workaround disabled, as we're trying another workaround
// To work around the bug described in
// https://github.com/coder/coder-desktop-macos/issues/121,
// we're going to manually reinstall after the replacement is done.
// If we returned `.cancel` here the deactivation request will fail as
// it looks for an extension with the *current* version string.
// There's no way to modify the deactivate request to use a different
// version string (i.e. `existing.bundleVersion`).
logger.info("App upgrade detected, replacing and then reinstalling")
action = .replacing
// logger.info("App upgrade detected, replacing and then reinstalling")
// action = .replacing
Copy link
Member Author

Choose a reason for hiding this comment

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

This disables the previous workaround (the extra prompts on upgrade)

return .replace
}
}
Expand Down
7 changes: 6 additions & 1 deletion Coder-Desktop/VPN/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
<key>NetworkExtension</key>
<dict>
<key>NEMachServiceName</key>
<string>$(TeamIdentifierPrefix)com.coder.Coder-Desktop.VPN</string>
<!-- We append the CFBundleVersion to the service name to ensure a new
service is used for each version. This works around the issue described
in https://github.com/coder/coder-desktop-macos/issues/121, presumably
caused by the XPC service cache not being invalidated on update.
-->
<string>$(TeamIdentifierPrefix)com.coder.Coder-Desktop.VPN.$(CURRENT_PROJECT_VERSION)</string>
<key>NEProviderClasses</key>
<dict>
<key>com.apple.networkextension.packet-tunnel</key>
Expand Down
Loading