π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Clean up Ensu reset artifacts
Manav Rathic72d92f3950a
diff --git a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/chat/RustChatRepository.kt b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/chat/RustChatRepository.ktindex f91b4888d1..83b509f16f 100644--- a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/chat/RustChatRepository.kt+++ b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/chat/RustChatRepository.kt@@ -135,8 +135,11 @@ class RustChatRepository(}override fun deleteAllData() {+ // Full reset removes current storage plus legacy sync leftovers.dbFile.delete()attachmentsDbFile.delete()+ filePaths.legacyOnlineDbFile.delete()+ filePaths.legacySyncDir.deleteRecursively()filePaths.attachmentsDir.deleteRecursively()filePaths.attachmentsDir.mkdirs()diff --git a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/storage/FilePathManager.kt b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/storage/FilePathManager.ktindex 4c88d62ff7..507e2a17d6 100644--- a/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/storage/FilePathManager.kt+++ b/mobile/native/android/apps/ensu/data/src/main/java/io/ente/ensu/data/storage/FilePathManager.kt@@ -8,6 +8,8 @@ class FilePathManager(context: Context) {val attachmentsDir: File = ensureDir(File(appDataDir, "attachments"))val mainDbFile: File = File(appDataDir, "llmchat.db")val attachmentsDbFile: File = File(appDataDir, "llmchat_sync.db")+ val legacyOnlineDbFile: File = File(appDataDir, "llmchat_online.db")+ val legacySyncDir: File = File(appDataDir, "llmchat")private fun ensureDir(dir: File): File {if (!dir.exists()) {diff --git a/mobile/native/apple/apps/ensu/Ensu/Chat/ChatDataCleaner.swift b/mobile/native/apple/apps/ensu/Ensu/Chat/ChatDataCleaner.swiftindex d71dfa4212..42b3eebc4d 100644--- a/mobile/native/apple/apps/ensu/Ensu/Chat/ChatDataCleaner.swift+++ b/mobile/native/apple/apps/ensu/Ensu/Chat/ChatDataCleaner.swift@@ -8,10 +8,17 @@ enum ChatDataCleaner {let mainDbUrl = dbDir.appendingPathComponent("llmchat.db")let attachmentsDbUrl = dbDir.appendingPathComponent("llmchat_sync.db")+ let onlineDbUrl = dbDir.appendingPathComponent("llmchat_online.db")let attachmentsDirUrl = dbDir.appendingPathComponent("chat_attachments", isDirectory: true)+ let encryptedAttachmentsDirUrl = dbDir.appendingPathComponent("chat_attachments_encrypted", isDirectory: true)+ let metaDirUrl = dbDir.appendingPathComponent("sync_meta", isDirectory: true)+ // Full reset removes current storage plus legacy sync leftovers.try? FileManager.default.removeItem(at: mainDbUrl)try? FileManager.default.removeItem(at: attachmentsDbUrl)+ try? FileManager.default.removeItem(at: onlineDbUrl)try? FileManager.default.removeItem(at: attachmentsDirUrl)+ try? FileManager.default.removeItem(at: encryptedAttachmentsDirUrl)+ try? FileManager.default.removeItem(at: metaDirUrl)}}