Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override build version and update promise reqs #983

Merged
merged 7 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions ios/BT/ExposureManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -488,19 +488,19 @@ final class ExposureManager: NSObject {
// Abort because daily file capacity is exceeded
return []
}
let indexFileString = try await(self.fetchIndexFile())
let indexFileString = try awaitPromise(self.fetchIndexFile())
let remoteURLs = indexFileString.gaenFilePaths
let targetUrls = self.urlPathsToProcess(remoteURLs, apiVersion: .V1)
lastProcessedUrlPath = targetUrls.last ?? .default
processedFileCount = targetUrls.count
let downloadedKeyArchives = try await(self.downloadKeyArchives(targetUrls: targetUrls))
unpackedArchiveURLs = try await(self.unpackKeyArchives(packages: downloadedKeyArchives))
let exposureConfiguration = try await(self.getExposureConfigurationV1())
let exposureSummary = try await(self.callDetectExposures(configuration: exposureConfiguration.asENExposureConfiguration,
let downloadedKeyArchives = try awaitPromise(self.downloadKeyArchives(targetUrls: targetUrls))
unpackedArchiveURLs = try awaitPromise(self.unpackKeyArchives(packages: downloadedKeyArchives))
let exposureConfiguration = try awaitPromise(self.getExposureConfigurationV1())
let exposureSummary = try awaitPromise(self.callDetectExposures(configuration: exposureConfiguration.asENExposureConfiguration,
diagnosisKeyURLs: unpackedArchiveURLs))
var newExposures: [Exposure] = []
if let summary = exposureSummary, summary.isAboveScoreThreshold(with: exposureConfiguration) {
newExposures = try await(self.getExposureInfoAndNotifyUser(summary: summary))
newExposures = try awaitPromise(self.getExposureInfoAndNotifyUser(summary: summary))
}
return newExposures
}.then { result in
Expand Down Expand Up @@ -539,15 +539,15 @@ final class ExposureManager: NSObject {
throw ExposureError.default("Detection Already in Progress")
}
self.isDetectingExposures = true
let indexFileString = try await(self.fetchIndexFile())
let indexFileString = try awaitPromise(self.fetchIndexFile())
let remoteURLs = indexFileString.gaenFilePaths
let targetUrls = self.urlPathsToProcess(remoteURLs, apiVersion: .V2)
lastProcessedUrlPath = targetUrls.last ?? .default
processedFileCount = targetUrls.count
let downloadedKeyArchives = try await(self.downloadKeyArchives(targetUrls: targetUrls))
unpackedArchiveURLs = try await(self.unpackKeyArchives(packages: downloadedKeyArchives))
let exposureConfiguraton = try await(self.getExposureConfigurationV2())
let exposureSummary = try await(self.callDetectExposures(configuration: exposureConfiguraton.asENExposureConfiguration,
let downloadedKeyArchives = try awaitPromise(self.downloadKeyArchives(targetUrls: targetUrls))
unpackedArchiveURLs = try awaitPromise(self.unpackKeyArchives(packages: downloadedKeyArchives))
let exposureConfiguraton = try awaitPromise(self.getExposureConfigurationV2())
let exposureSummary = try awaitPromise(self.callDetectExposures(configuration: exposureConfiguraton.asENExposureConfiguration,
diagnosisKeyURLs: unpackedArchiveURLs))
var newExposures: [Exposure] = []
if let summary = exposureSummary {
Expand Down
4 changes: 2 additions & 2 deletions ios/COVIDSafePathsTests/ExposureManagerUnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class ExposureManagerUnitTests: XCTestCase {
let expectation = self.expectation(description: "it falls back to the placeholder exposure configuration")
let exposureManager = defaultExposureManager(enAPIVersion: .v1, forceDownloadConfigurationError: true)
do {
let config = try await(exposureManager.getExposureConfigurationV1())
let config = try awaitPromise(exposureManager.getExposureConfigurationV1())
XCTAssertEqual(config, ExposureConfigurationV1.placeholder)
expectation.fulfill()
} catch {
Expand All @@ -601,7 +601,7 @@ class ExposureManagerUnitTests: XCTestCase {
let expectation = self.expectation(description: "it falls back to the placeholder exposure configuration")
let exposureManager = defaultExposureManager(enAPIVersion: .v2, forceDownloadConfigurationError: true)
do {
let config = try await(exposureManager.getExposureConfigurationV2())
let config = try awaitPromise(exposureManager.getExposureConfigurationV2())
XCTAssertEqual(config, DailySummariesConfiguration.placeholder)
expectation.fulfill()
} catch {
Expand Down
2 changes: 1 addition & 1 deletion ios/COVIDSafePathsTests/V2UnitTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class V2UnitTests: XCTestCase {
let exposureManager = defaultExposureManager(enAPIVersion: .v2,
forceDownloadConfigurationError: true)
do {
let config = try await(exposureManager.getExposureConfigurationV2())
let config = try awaitPromise(exposureManager.getExposureConfigurationV2())
XCTAssertEqual(config, DailySummariesConfiguration.placeholder)
} catch {
XCTFail()
Expand Down
7 changes: 7 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ def shared_pods
use_flipper!('Flipper' => '0.86.0', 'Flipper-Folly' => '2.5.3')
post_install do |installer|
flipper_post_install(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 9.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
end

Expand Down
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ PODS:
- OpenSSL-Universal (1.1.180)
- Permission-Notifications (2.2.2):
- RNPermissions
- PromisesObjC (1.2.12)
- PromisesSwift (1.2.12):
- PromisesObjC (= 1.2.12)
- PromisesObjC (2.0.0)
- PromisesSwift (2.0.0):
- PromisesObjC (= 2.0.0)
- RCT-Folly (2020.01.13.00):
- boost-for-react-native
- DoubleConversion
Expand Down