OSSystemExtensionRequest not superseding previous requests

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's request(_:didFailWithError:) is being called with error OSSystemExtensionErrorRequestSuperseded. When debugging this in someone else's system the delegate is not being called at all, even though a new request is being queued.

Add a Comment

Replies

Why could it be that only I am seeing a different behaviour?

What is the procedure that you're using for testing this? Are you building your app and system extension and then install it into the Applications directory on your test Mac and then running it and debugging it from the Terminal? Or are you using another flow like debugging this from Xcode directly? If it is from Xcode directly you'll want to use the Applications directory route.

  • I'm running both debug builds and release builds (both installed in /Applications). And other people seeing the different behaviour are running both the debug and review builds I'm using too.

Add a Comment