Are network-extension types safe to mark as Send/Sync?
Currently, all the types from objc2-network-extension are currently marked as !Send/!Sync. This is fairly inconvenient, and doesn't seem to be necessary? For instance, NEFilterFlow/NEFilterSocketFlow seem to just be data containers with no internal mutability, so there shouldn't be any problem in making them sharable across threads.
Is this wrong? And if it isn't, is there any plans to make those types Send/Sync?
They aren't Send/Sync because they aren't Sendable in Swift either:
// swift -swift-version 6 foo.swift
import NetworkExtension
func make_sendable(flow: NEFilterFlow) -> Sendable {
return flow // fails
}
We can fix this locally in objc2-network-extension (feel free to submit a PR, you mostly just need to add a file with the impls and reasoning), though I'd prefer if you submitted this directly to Apple through their Feedback Assistant or similar, I'd feel much more comfortable with making these types Send/Sync if Apple does so too.