From dbf2e348f1d40374025f30ce224ee0c0f17d2093 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Tue, 31 Oct 2023 18:19:44 +0400 Subject: [PATCH] Never delete data in extensions --- .../Sources/AccountManager/AccountManagerImpl.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift b/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift index ae16e37e3a..47e50411d9 100644 --- a/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift +++ b/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift @@ -124,8 +124,11 @@ final class AccountManagerImpl { self.currentAtomicState = atomicState } catch let e { postboxLog("decode atomic state error: \(e)") - let _ = try? FileManager.default.removeItem(atPath: self.atomicStatePath) postboxLogSync() + + if removeDatabaseOnError { + let _ = try? FileManager.default.removeItem(atPath: self.atomicStatePath) + } preconditionFailure() } } catch let e {