Add one time wipe of logs for iOS

This commit is contained in:
advplyr
2026-09-10 17:03:20 -05:00
parent 7292e367d2
commit 9a2f0c3e4a
+5 -1
View File
@@ -12,7 +12,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.
let configuration = Realm.Configuration(
schemaVersion: 20,
schemaVersion: 21,
migrationBlock: { [weak self] migration, oldSchemaVersion in
if (oldSchemaVersion < 1) {
AbsLogger.info(message: "Realm schema version was \(oldSchemaVersion)")
@@ -71,6 +71,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
newObject?["version"] = ""
}
}
if (oldSchemaVersion < 21) {
// One-time wipe of accumulated logs that were freezing the app on load/clear
migration.deleteData(forType: LogEntry.className())
}
}
)
Realm.Configuration.defaultConfiguration = configuration