fix(apple): move reset command to work queue (#10707)

Fixes
[APPLE-CLIENT-7S](https://sentry.io/organizations/firezone-inc/issues/6812982801/).
The issue was that: Synchronous access to
`Adapter.systemConfigurationResolvers` during concurrent deallocation
causes an EXC_BAD_ACCESS crash.

- Moves the `reset` command execution to the `workQueue` to prevent
potential deadlocks or race conditions when accessing shared resources
or interacting with the network extension's internal state.


This fix was generated by Seer in Sentry, triggered by
jamil@firezone.dev. 👁️ Run ID: 2183818

Not quite right? [Click here to continue debugging with
Seer.](https://sentry.io/organizations/firezone-inc/issues/6812982801/?seerDrawer=true)


Fixes #10195

---------

Co-authored-by: seer-by-sentry[bot] <157164994+seer-by-sentry[bot]@users.noreply.github.com>
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
This commit is contained in:
seer-by-sentry[bot]
2025-10-30 18:11:45 +10:30
committed by GitHub
parent 3308e3c010
commit ac7aaf820c

View File

@@ -319,10 +319,13 @@ class Adapter: @unchecked Sendable {
}
func reset(reason: String, path: Network.NWPath? = nil) {
sendCommand(.reset(reason))
workQueue.async { [weak self] in
guard let self = self else { return }
self.sendCommand(.reset(reason))
if let path = (path ?? lastPath) {
setSystemDefaultResolvers(path)
if let path = (path ?? self.lastPath) {
self.setSystemDefaultResolvers(path)
}
}
}