I'm working on a VPN App that uses a NEPacketTunnelProvider
system extension.
On my computer, when sending out the first OSSystemExtensionRequest
requesting that the extension is installed / activated, a system alert is shown to the user informing them that the extension installation was blocked. This is fine.
Each time the user starts the process again (for whatever reason) we're sending out a new OSSystemExtensionRequest
.
And this is where it gets strange:
- On my computers (I've tried on my development and personal one) the previous request is immediately cancelled with a
OSSystemExtensionErrorRequestSuperseded
error and a new alert is shown. - For everyone else trying this out, the previous request is not being cancelled at all and it seems like requests are silently piling up. Newly-sent requests do trigger the delegate's
requestNeedsUserApproval(_:)
. But because they're piling up users are not shown a new system alert, breaking the UX.
I guess I could evaluate if there's an existing request to avoid sending out a new one, but this is only supported in macOS 12+ through (propertiesRequest(forExtensionWithIdentifier:queue:)
).
My questions:
- Which of the above is the correct behaviour?
- Why could it be that only I am seeing a different behaviour?
Some additional information: we did try debugging this issue and in my case
OSSystemExtensionRequestDelegate
'srequest(_:didFailWithError:)
is being called with errorOSSystemExtensionErrorRequestSuperseded
. When debugging this in someone else's system the delegate is not being called at all, even though a new request is being queued.