Fixed a crash due to an assertion for encryption on the main thread

Removed some commented out code
This commit is contained in:
Morgan Pretty 2023-08-09 15:22:42 +10:00
parent 87668d86a1
commit 1a383ea850
2 changed files with 6 additions and 22 deletions

View File

@ -81,7 +81,9 @@ public enum PushRegistrationError: Error {
return
}
vanillaTokenResolver(Result.success(tokenData))
DispatchQueue.global(qos: .default).async {
vanillaTokenResolver(Result.success(tokenData))
}
}
// Vanilla push token is obtained from the system via AppDelegate
@ -92,7 +94,9 @@ public enum PushRegistrationError: Error {
return
}
vanillaTokenResolver(Result.failure(error))
DispatchQueue.global(qos: .default).async {
vanillaTokenResolver(Result.failure(error))
}
}
// MARK: helpers

View File

@ -681,26 +681,6 @@ public final class JobRunner: JobRunnerType {
queues.wrappedValue[job.variant]?.removePendingJob(jobId)
}
//public static func hasPendingOrRunningJob<T: Encodable>(
// with variant: Job.Variant,
// threadId: String? = nil,
// interactionId: Int64? = nil,
// details: T? = nil
//) -> Bool {
// guard let targetQueue: JobQueue = queues.wrappedValue[variant] else { return false }
//
// // Ensure we can encode the details (if provided)
// let detailsData: Data? = details.map { try? JSONEncoder().encode($0) }
//
// guard details == nil || detailsData != nil else { return false }
//
// return targetQueue.hasPendingOrRunningJobWith(
// threadId: threadId,
// interactionId: interactionId,
// detailsData: detailsData
// )
//}
// MARK: - Convenience