Skip backup repository on simulator (#1048)

ProfileManager is behaving crazy because on simulator local and backup
repository point to the same container.
This commit is contained in:
Davide 2025-01-04 10:45:51 +01:00 committed by GitHub
parent edb7c29b26
commit 24ddb270aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -182,7 +182,7 @@ private extension CoreDataRepository {
let newController = NSFetchedResultsController( let newController = NSFetchedResultsController(
fetchRequest: request, fetchRequest: request,
managedObjectContext: self.context, managedObjectContext: context,
sectionNameKeyPath: nil, sectionNameKeyPath: nil,
cacheName: nil cacheName: nil
) )

View File

@ -90,6 +90,7 @@ extension AppContext {
model: cdRemoteModel, model: cdRemoteModel,
observingResults: true observingResults: true
) )
let backupProfileRepository: ProfileRepository? = nil
#else #else
let tunnelStrategy = NETunnelStrategy( let tunnelStrategy = NETunnelStrategy(
bundleIdentifier: BundleConfiguration.mainString(for: .tunnelId), bundleIdentifier: BundleConfiguration.mainString(for: .tunnelId),
@ -99,15 +100,16 @@ extension AppContext {
let mainProfileRepository = NEProfileRepository(repository: tunnelStrategy) { let mainProfileRepository = NEProfileRepository(repository: tunnelStrategy) {
dependencies.profileTitle($0) dependencies.profileTitle($0)
} }
let backupProfileRepository = dependencies.backupProfileRepository(
model: cdRemoteModel,
observingResults: false
)
#endif #endif
let profileManager = ProfileManager( let profileManager = ProfileManager(
processor: processor, processor: processor,
repository: mainProfileRepository, repository: mainProfileRepository,
backupRepository: dependencies.backupProfileRepository( backupRepository: backupProfileRepository,
model: cdRemoteModel,
observingResults: false
),
mirrorsRemoteRepository: dependencies.mirrorsRemoteRepository, mirrorsRemoteRepository: dependencies.mirrorsRemoteRepository,
readyAfterRemote: true readyAfterRemote: true
) )