Discard old profiles once migrated (#884)

Otherwise, they would reappear if the migrated profiles are deleted from
the new store.
This commit is contained in:
Davide 2024-11-17 11:40:49 +01:00 committed by GitHub
parent d3e344670b
commit 22e8e659e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -190,6 +190,12 @@ private extension MigrateView {
model.statuses[$0.id] == .done
}
pp_log(.App.migration, .notice, "Migrated \(migrated.count) profiles")
do {
try await migrationManager.deleteMigratableProfiles(withIds: Set(migrated.map(\.id)))
pp_log(.App.migration, .notice, "Discarded \(migrated.count) migrated profiles from old store")
} catch {
pp_log(.App.migration, .error, "Unable to discard migrated profiles: \(error)")
}
model.step = .migrated(migrated)
} catch {
pp_log(.App.migration, .error, "Unable to migrate profiles: \(error)")