diff --git a/Cryptomator.xcodeproj/project.pbxproj b/Cryptomator.xcodeproj/project.pbxproj index 179c34196..a0b012550 100644 --- a/Cryptomator.xcodeproj/project.pbxproj +++ b/Cryptomator.xcodeproj/project.pbxproj @@ -3243,7 +3243,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.4.0; + MARKETING_VERSION = 2.4.1; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -3305,7 +3305,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MARKETING_VERSION = 2.4.0; + MARKETING_VERSION = 2.4.1; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200"; diff --git a/CryptomatorFileProvider/DB/ItemMetadataDBManager.swift b/CryptomatorFileProvider/DB/ItemMetadataDBManager.swift index bf089d7b6..93518a375 100644 --- a/CryptomatorFileProvider/DB/ItemMetadataDBManager.swift +++ b/CryptomatorFileProvider/DB/ItemMetadataDBManager.swift @@ -80,38 +80,19 @@ class ItemMetadataDBManager: ItemMetadataManager { } } + // TODO: Optimize Code and/or DB Scheme func cacheMetadata(_ itemMetadataList: [ItemMetadata]) throws { try database.write { db in for metadata in itemMetadataList { - try db.execute( - sql: """ - INSERT INTO \(ItemMetadata.databaseTableName) - (\(ItemMetadata.Columns.name), \(ItemMetadata.Columns.type), \(ItemMetadata.Columns.size), \(ItemMetadata.Columns.parentID), \(ItemMetadata.Columns.lastModifiedDate), \(ItemMetadata.Columns.statusCode), \(ItemMetadata.Columns.cloudPath), \(ItemMetadata.Columns.isPlaceholderItem), \(ItemMetadata.Columns.isMaybeOutdated), \(ItemMetadata.Columns.favoriteRank), \(ItemMetadata.Columns.tagData)) VALUES - (:name, :type, :size, :parentID, :lastModifiedDate, :statusCode, :cloudPath, :isPlaceholderItem, :isMaybeOutdated, :favoriteRank, :tagData) - ON CONFLICT (\(ItemMetadata.Columns.cloudPath)) - DO UPDATE SET \(ItemMetadata.Columns.name) = excluded.\(ItemMetadata.Columns.name), - \(ItemMetadata.Columns.type) = excluded.\(ItemMetadata.Columns.type), - \(ItemMetadata.Columns.size) = excluded.\(ItemMetadata.Columns.size), - \(ItemMetadata.Columns.parentID) = excluded.\(ItemMetadata.Columns.parentID), - \(ItemMetadata.Columns.lastModifiedDate) = excluded.\(ItemMetadata.Columns.lastModifiedDate), - \(ItemMetadata.Columns.cloudPath) = excluded.\(ItemMetadata.Columns.cloudPath), - \(ItemMetadata.Columns.isPlaceholderItem) = excluded.\(ItemMetadata.Columns.isPlaceholderItem), - \(ItemMetadata.Columns.isMaybeOutdated) = excluded.\(ItemMetadata.Columns.isMaybeOutdated) - """, - arguments: ["name": metadata.name, - "type": metadata.type, - "size": metadata.size, - "parentID": metadata.parentID, - "lastModifiedDate": metadata.lastModifiedDate, - "statusCode": metadata.statusCode, - "cloudPath": metadata.cloudPath, - "isPlaceholderItem": metadata.isPlaceholderItem, - "isMaybeOutdated": metadata.isMaybeOutdated, - "favoriteRank": metadata.favoriteRank, - "tagData": metadata.tagData] - ) - let metadataID = db.lastInsertedRowID - metadata.id = metadataID + if let cachedMetadata = try ItemMetadata.fetchOne(db, key: ["cloudPath": metadata.cloudPath]) { + metadata.id = cachedMetadata.id + metadata.statusCode = cachedMetadata.statusCode + metadata.tagData = cachedMetadata.tagData + metadata.favoriteRank = cachedMetadata.favoriteRank + try metadata.update(db) + } else { + try metadata.insert(db) + } } } } diff --git a/fastlane/changelog.txt b/fastlane/changelog.txt index f4413c48e..d576777dc 100644 --- a/fastlane/changelog.txt +++ b/fastlane/changelog.txt @@ -1,3 +1,5 @@ +Hotfix for "empty vaults" bug. Here are the release notes of 2.4.0: + - Added support for S3 (#238) - Added additional Shortcut intents for "Get Lock Status", "Open Vault", and "Lock Vault" (#229, #233) - Added quicker unlock when Touch ID / Face ID is set up (#225) diff --git a/fastlane/metadata/de-DE/release_notes.txt b/fastlane/metadata/de-DE/release_notes.txt index 1420f8a3e..736e0b190 100644 --- a/fastlane/metadata/de-DE/release_notes.txt +++ b/fastlane/metadata/de-DE/release_notes.txt @@ -1,3 +1,5 @@ +Hotfix für „leere Tresore“ Fehler. Hier sind die Release Notes von 2.4.0: + - Unterstützung für S3 hinzugefügt (#238) - Zusätzliche Shortcut-Intents für „Sperrstatus abfragen“, „Tresor öffnen“ und „Tresor sperren“ hinzugefügt (#229, #233) - Schnelleres Entsperren hinzugefügt, wenn Touch ID / Face ID eingerichtet ist (#225) diff --git a/fastlane/metadata/en-US/release_notes.txt b/fastlane/metadata/en-US/release_notes.txt index f4413c48e..d576777dc 100644 --- a/fastlane/metadata/en-US/release_notes.txt +++ b/fastlane/metadata/en-US/release_notes.txt @@ -1,3 +1,5 @@ +Hotfix for "empty vaults" bug. Here are the release notes of 2.4.0: + - Added support for S3 (#238) - Added additional Shortcut intents for "Get Lock Status", "Open Vault", and "Lock Vault" (#229, #233) - Added quicker unlock when Touch ID / Face ID is set up (#225)