From 765e68a4b401a05a22a266d277c93a64f1f280a5 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sat, 26 Jun 2021 21:16:45 +0400 Subject: [PATCH 1/4] Bump version --- versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.json b/versions.json index f528daa42c..c2ec49706b 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "7.8.1", + "app": "7.9", "bazel": "4.0.0", "xcode": "12.4" } From eaa582c78c1925d9ef2d72c59f1e4275508ae58a Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 27 Jun 2021 18:01:02 +0400 Subject: [PATCH 2/4] Unbump version --- versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.json b/versions.json index c2ec49706b..1329a183b7 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "7.9", + "app": "7.8.2", "bazel": "4.0.0", "xcode": "12.4" } From e6aad302dce4cb3c14d5a7d198fcab36c20cde9c Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 27 Jun 2021 18:07:50 +0400 Subject: [PATCH 3/4] Move data cleanup to background --- .../TelegramCore/Sources/AccountManager.swift | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/submodules/TelegramCore/Sources/AccountManager.swift b/submodules/TelegramCore/Sources/AccountManager.swift index e9da18ff19..b1e3d106d0 100644 --- a/submodules/TelegramCore/Sources/AccountManager.swift +++ b/submodules/TelegramCore/Sources/AccountManager.swift @@ -189,21 +189,23 @@ public func rootPathForBasePath(_ appGroupPath: String) -> String { } public func performAppGroupUpgrades(appGroupPath: String, rootPath: String) { - let _ = try? FileManager.default.createDirectory(at: URL(fileURLWithPath: rootPath), withIntermediateDirectories: true, attributes: nil) + DispatchQueue.global(qos: .default).async { + let _ = try? FileManager.default.createDirectory(at: URL(fileURLWithPath: rootPath), withIntermediateDirectories: true, attributes: nil) - if let items = FileManager.default.enumerator(at: URL(fileURLWithPath: appGroupPath), includingPropertiesForKeys: [.isDirectoryKey], options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants], errorHandler: nil) { - let allowedDirectories: [String] = [ - "telegram-data", - "Library" - ] + if let items = FileManager.default.enumerator(at: URL(fileURLWithPath: appGroupPath), includingPropertiesForKeys: [.isDirectoryKey], options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants], errorHandler: nil) { + let allowedDirectories: [String] = [ + "telegram-data", + "Library" + ] - for url in items { - guard let url = url as? URL else { - continue - } - if let isDirectory = try? url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory, isDirectory { - if !allowedDirectories.contains(url.lastPathComponent) { - let _ = try? FileManager.default.removeItem(at: url) + for url in items { + guard let url = url as? URL else { + continue + } + if let isDirectory = try? url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory, isDirectory { + if !allowedDirectories.contains(url.lastPathComponent) { + let _ = try? FileManager.default.removeItem(at: url) + } } } } From e2e669e74b55c90ce224eaf2d05f9d043537bf98 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Sun, 27 Jun 2021 19:32:14 +0400 Subject: [PATCH 4/4] Revert "Unbump version" This reverts commit eaa582c78c1925d9ef2d72c59f1e4275508ae58a. --- versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.json b/versions.json index 1329a183b7..c2ec49706b 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "7.8.2", + "app": "7.9", "bazel": "4.0.0", "xcode": "12.4" }