Do not require purchase for empty on-demand rules (#1089)

Major issue with migrated profiles with the "Excluding" policy. Existing
users are being opted into an unnecessary purchase.
This commit is contained in:
Davide 2025-01-20 14:49:47 +01:00 committed by GitHub
parent bb49ccaffb
commit 1414080ea9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,11 @@ extension OnDemandModule.Builder: AppFeatureRequiring {
guard isEnabled else {
return []
}
return policy != .any ? [.onDemand] : []
// empty rules require no purchase
if !withMobileNetwork && !withEthernetNetwork && !withSSIDs.map(\.value).contains(true) {
return []
}
return [.onDemand]
}
}