diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 2ec389697..5a3aa2eaa 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -7923,7 +7923,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 533; + CURRENT_PROJECT_VERSION = 534; ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -7999,7 +7999,7 @@ CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; - CURRENT_PROJECT_VERSION = 533; + CURRENT_PROJECT_VERSION = 534; ENABLE_BITCODE = NO; ENABLE_MODULE_VERIFIER = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/Session/Settings/DeveloperSettingsViewModel.swift b/Session/Settings/DeveloperSettingsViewModel.swift index 0f8282fad..2dc84e2b7 100644 --- a/Session/Settings/DeveloperSettingsViewModel.swift +++ b/Session/Settings/DeveloperSettingsViewModel.swift @@ -1265,9 +1265,18 @@ class DeveloperSettingsViewModel: SessionTableViewModel, NavigatableStateHolder, at: URL( fileURLWithPath: dependencies[singleton: .fileManager].appSharedDataDirectoryPath ), - includingPropertiesForKeys: [.isRegularFileKey] + includingPropertiesForKeys: [.isRegularFileKey, .isHiddenKey] ) - let fileUrls: [URL] = (deleteEnumerator?.allObjects.compactMap { $0 as? URL } ?? []) + let fileUrls: [URL] = (deleteEnumerator?.allObjects + .compactMap { $0 as? URL } + .filter { url -> Bool in + guard let resourceValues = try? url.resourceValues(forKeys: [.isHiddenKey]) else { + return true + } + + return (resourceValues.isHidden != true) + }) + .defaulting(to: []) try fileUrls.forEach { url in /// The database `wal` and `shm` files might not exist anymore at this point /// so we should only remove files which exist to prevent errors