Reject API response requiring more recent build

This commit is contained in:
Davide De Rosa 2018-10-18 14:00:34 +02:00
parent 567ddd9b12
commit 8d1acda11a
2 changed files with 10 additions and 0 deletions

View File

@ -43,6 +43,8 @@ struct Infrastructure: Codable {
let preset: String
}
let build: Int
let name: Name
let pools: [Pool]

View File

@ -143,6 +143,14 @@ class InfrastructureFactory {
}
return
}
let appBuild = GroupConstants.App.buildNumber
guard appBuild >= infra.build else {
log.error("Response requires app build >= \(infra.build) (found \(appBuild))")
DispatchQueue.main.async {
completionHandler(nil, error)
}
return
}
var isNewer = true
if let bundleDate = self.bundleModificationDate(for: name) {