|
|
@ -139,7 +139,6 @@ class LegacyContactDiscoveryBatchOperation: OWSOperation {
|
|
|
|
enum ContactDiscoveryError: Error {
|
|
|
|
enum ContactDiscoveryError: Error {
|
|
|
|
case parseError(description: String)
|
|
|
|
case parseError(description: String)
|
|
|
|
case assertionError(description: String)
|
|
|
|
case assertionError(description: String)
|
|
|
|
case attestationError(underlyingError: Error)
|
|
|
|
|
|
|
|
case clientError(underlyingError: Error)
|
|
|
|
case clientError(underlyingError: Error)
|
|
|
|
case serverError(underlyingError: Error)
|
|
|
|
case serverError(underlyingError: Error)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -234,13 +233,7 @@ class CDSBatchOperation: OWSOperation {
|
|
|
|
contactDiscoveryService.performRemoteAttestation(success: { (remoteAttestation: RemoteAttestation) in
|
|
|
|
contactDiscoveryService.performRemoteAttestation(success: { (remoteAttestation: RemoteAttestation) in
|
|
|
|
self.makeContactDiscoveryRequest(remoteAttestation: remoteAttestation)
|
|
|
|
self.makeContactDiscoveryRequest(remoteAttestation: remoteAttestation)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
failure: self.attestationFailure)
|
|
|
|
failure: self.reportError)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func attestationFailure(error: Error) {
|
|
|
|
|
|
|
|
let attestationError: NSError = ContactDiscoveryError.attestationError(underlyingError: error) as NSError
|
|
|
|
|
|
|
|
attestationError.isRetryable = false
|
|
|
|
|
|
|
|
self.reportError(attestationError)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private func makeContactDiscoveryRequest(remoteAttestation: RemoteAttestation) {
|
|
|
|
private func makeContactDiscoveryRequest(remoteAttestation: RemoteAttestation) {
|
|
|
@ -462,7 +455,7 @@ class CDSFeedbackOperation: OWSOperation {
|
|
|
|
case ContactDiscoveryError.serverError, ContactDiscoveryError.clientError:
|
|
|
|
case ContactDiscoveryError.serverError, ContactDiscoveryError.clientError:
|
|
|
|
// Server already has this information, no need submit feedback
|
|
|
|
// Server already has this information, no need submit feedback
|
|
|
|
self.reportSuccess()
|
|
|
|
self.reportSuccess()
|
|
|
|
case ContactDiscoveryError.attestationError:
|
|
|
|
case ContactDiscoveryServiceError.attestationFailed:
|
|
|
|
self.makeRequest(result: .attestationError)
|
|
|
|
self.makeRequest(result: .attestationError)
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
self.makeRequest(result: .unexpectedError)
|
|
|
|
self.makeRequest(result: .unexpectedError)
|
|
|
|