Kill StorageServiceManagerImpl.shared

This commit is contained in:
Harry 2024-09-27 07:55:23 -07:00 committed by GitHub
parent ba333be714
commit 0cd93fa007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -179,7 +179,7 @@ public class AppSetup {
)
let signalService = testDependencies.signalService ?? OWSSignalService()
let signalServiceAddressCache = SignalServiceAddressCache()
let storageServiceManager = testDependencies.storageServiceManager ?? StorageServiceManagerImpl.shared
let storageServiceManager = testDependencies.storageServiceManager ?? StorageServiceManagerImpl()
let syncManager = testDependencies.syncManager ?? OWSSyncManager(default: ())
let udManager = OWSUDManagerImpl()
let versionedProfiles = testDependencies.versionedProfiles ?? VersionedProfilesImpl()

View File

@ -10,11 +10,6 @@ import SwiftProtobuf
public class StorageServiceManagerImpl: NSObject, StorageServiceManager {
// TODO: We could convert this into a SSKEnvironment accessor so that we
// can replace it in tests.
@objc
public static let shared = StorageServiceManagerImpl()
private let operationQueue: OperationQueue = {
let queue = OperationQueue()
queue.maxConcurrentOperationCount = 1
@ -1131,6 +1126,7 @@ class StorageServiceOperation: OWSOperation {
}
}.done(on: DispatchQueue.global()) { updatedState in
var mutableState = updatedState
let storageServiceManager = self.storageServiceManager
self.databaseStorage.write { transaction in
// Update the manifest version to reflect the remote version we just restored to
mutableState.manifestVersion = manifest.version
@ -1238,7 +1234,7 @@ class StorageServiceOperation: OWSOperation {
mutableState.save(clearConsecutiveConflicts: true, transaction: transaction)
if backupAfterSuccess {
StorageServiceManagerImpl.shared.backupPendingChanges(authedDevice: self.authedDevice)
storageServiceManager.backupPendingChanges(authedDevice: self.authedDevice)
}
}
self.reportSuccess()