Skip to content

Commit 596286d

Browse files
committed
Merge branch 'macos-add-split-tunnel-error-info'
2 parents 2b04fed + 6289b4c commit 596286d

File tree

12 files changed

+218
-57
lines changed

12 files changed

+218
-57
lines changed

gui/locales/messages.pot

+4
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,10 @@ msgctxt "notifications"
10861086
msgid "Disconnected and unsecure"
10871087
msgstr ""
10881088

1089+
msgctxt "notifications"
1090+
msgid "Failed to enable split tunneling. Please try again or disable it."
1091+
msgstr ""
1092+
10891093
msgctxt "notifications"
10901094
msgid "Lockdown mode active, connection blocked"
10911095
msgstr ""

gui/src/main/daemon-rpc.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,12 @@ function convertFromTunnelStateError(state: grpcTypes.ErrorState.AsObject): Erro
10461046
...baseError,
10471047
cause: ErrorStateCause.splitTunnelError,
10481048
};
1049+
case grpcTypes.ErrorState.Cause.NEED_FULL_DISK_PERMISSIONS:
1050+
// TODO: handle correctly
1051+
return {
1052+
...baseError,
1053+
cause: ErrorStateCause.splitTunnelError,
1054+
};
10491055
case grpcTypes.ErrorState.Cause.VPN_PERMISSION_DENIED:
10501056
// VPN_PERMISSION_DENIED is only ever created on Android
10511057
throw invalidErrorStateCause;

gui/src/shared/notifications/error.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,18 @@ function getMessage(errorState: ErrorState): string {
183183
'Your device is offline. The tunnel will automatically connect once your device is back online.',
184184
);
185185
case ErrorStateCause.splitTunnelError:
186-
return messages.pgettext(
187-
'notifications',
188-
'Unable to communicate with Mullvad kernel driver. Try reconnecting or send a problem report.',
189-
);
186+
switch (process.platform ?? window.env.platform) {
187+
case 'darwin':
188+
return messages.pgettext(
189+
'notifications',
190+
'Failed to enable split tunneling. Please try again or disable it.',
191+
);
192+
default:
193+
return messages.pgettext(
194+
'notifications',
195+
'Unable to communicate with Mullvad kernel driver. Try reconnecting or send a problem report.',
196+
);
197+
}
190198
}
191199
}
192200
}
@@ -265,6 +273,7 @@ function getActions(errorState: ErrorState): InAppNotificationAction | void {
265273
},
266274
};
267275
} else if (errorState.cause === ErrorStateCause.splitTunnelError) {
276+
// TODO: macos: handle this and full disk access error
268277
return {
269278
type: 'troubleshoot-dialog',
270279
troubleshoot: {

mullvad-management-interface/proto/management_interface.proto

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ message ErrorState {
142142
IS_OFFLINE = 7;
143143
VPN_PERMISSION_DENIED = 8;
144144
SPLIT_TUNNEL_ERROR = 9;
145+
NEED_FULL_DISK_PERMISSIONS = 10;
145146
}
146147

147148
enum AuthFailedError {

mullvad-management-interface/src/types/conversions/states.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ impl From<mullvad_types::states::TunnelState> for proto::TunnelState {
107107
talpid_tunnel::ErrorStateCause::SplitTunnelError => {
108108
i32::from(Cause::SplitTunnelError)
109109
}
110+
#[cfg(target_os = "macos")]
111+
talpid_tunnel::ErrorStateCause::NeedFullDiskPermissions => {
112+
i32::from(Cause::NeedFullDiskPermissions)
113+
}
110114
},
111115
blocking_error: error_state.block_failure().map(map_firewall_error),
112116
auth_failed_error: mullvad_types::auth_failed::AuthFailed::try_from(
@@ -325,10 +329,14 @@ impl TryFrom<proto::TunnelState> for mullvad_types::states::TunnelState {
325329
Ok(proto::error_state::Cause::VpnPermissionDenied) => {
326330
talpid_tunnel::ErrorStateCause::VpnPermissionDenied
327331
}
328-
#[cfg(target_os = "windows")]
332+
#[cfg(any(target_os = "windows", target_os = "macos"))]
329333
Ok(proto::error_state::Cause::SplitTunnelError) => {
330334
talpid_tunnel::ErrorStateCause::SplitTunnelError
331335
}
336+
#[cfg(target_os = "macos")]
337+
Ok(proto::error_state::Cause::NeedFullDiskPermissions) => {
338+
talpid_tunnel::ErrorStateCause::NeedFullDiskPermissions
339+
}
332340
_ => {
333341
return Err(FromProtobufTypeError::InvalidArgument(
334342
"invalid error cause",

0 commit comments

Comments
 (0)