mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-04 17:17:39 +00:00
ios: iCloud backup docs: toggle state when blocked
This commit is contained in:
1 parent
475bf4daa2
commit
f631fe2d23
2 files changed
+2
-2
No files matched your search
@@ -78,7 +78,7 @@ The container choice is stored in `dbContainerGroupDefault` (`GroupDefaults`).
|
||||
|
||||
[`excludeAppDataFromBackup(_:)`](../SimpleXChat/FileUtils.swift#L73-L76) sets `isExcludedFromBackup` on the app group container as requested, clears it on the database files (`FileManager.copyItem` in `restoreBackup()` copies it from the `.bak` files), and always sets it on the Documents directory (legacy database, exported archives, migration files), `temp_files` (decrypted copies of files) and the `.bak` copies of the database (made by the core on passphrase changes and migrations, possibly unencrypted or with an old passphrase).
|
||||
|
||||
The app group container is included in backup when the "Enable iCloud backup" toggle in "Database passphrase & export" is on (`DEFAULT_ICLOUD_BACKUP`, off by default) and [`iCloudBackupBlock`](../Shared/Views/Database/DatabaseView.swift) returns `nil`: the database is in the app group container, encrypted, and its passphrase was set by the user, not the initial random one. Otherwise the toggle is disabled and shown off, and its footer states the reason. The toggle is also disabled while an operation on that screen is in progress (`progressIndicator`, e.g. while a database is imported or deleted), and while the database needs to be reopened after import, deletion or a passphrase change (`ChatModel.chatDbChanged`), until the chat is started, with the footer saying so first, as the database state may be out of date. The toggle shows the actual attribute of the container ([`appDataIncludedInBackup()`](../SimpleXChat/FileUtils.swift)). The keychain passphrase is stored with `kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly`, so on another device the user has to enter it after a restore.
|
||||
The app group container is included in backup when the "Enable iCloud backup" toggle in "Database passphrase & export" is on (`DEFAULT_ICLOUD_BACKUP`, off by default) and [`iCloudBackupBlock`](../Shared/Views/Database/DatabaseView.swift) returns `nil`: the database is in the app group container, encrypted, and its passphrase was set by the user, not the initial random one. When `iCloudBackupBlock` returns a reason, the toggle is disabled and shown off (it shows the container's actual state, so in the share-extension gap below it can still show on), and its footer states the reason. The toggle is also disabled while an operation on that screen is in progress (`progressIndicator`, e.g. while a database is imported or deleted), and while the database needs to be reopened after import, deletion or a passphrase change (`ChatModel.chatDbChanged`), until the chat is started, with the footer saying so first, as the database state may be out of date. The toggle shows the actual attribute of the container ([`appDataIncludedInBackup()`](../SimpleXChat/FileUtils.swift)). The keychain passphrase is stored with `kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly`, so on another device the user has to enter it after a restore.
|
||||
|
||||
[`updateAppDataBackup()`](../Shared/Views/Database/DatabaseView.swift) applies the rule in [`initializeChat`](../Shared/Model/SimpleXAPI.swift) after the database is opened and the file paths are set (the core re-creates `temp_files` then) — but not when `chatMigrateInit` returns its cached result without opening the database (e.g. unlocking the app after an import with the chat stopped), as the state would be of the previous database, after a successful passphrase change in [`DatabaseEncryptionView`](../Shared/Views/Database/DatabaseEncryptionView.swift), and when the toggle changes. [`prepareForLaunch()`](../Shared/AppDelegate.swift#L124-L127) calls `updateAppDataBackupOnLaunch()` before the database is opened. It never includes the app data, as encryption is only known once the database is opened: it excludes it when the toggle is off, the database is in Documents or uses the initial random passphrase, or the passphrase is stored in the keychain but no key is stored (the database is unencrypted, or its passphrase is not available yet — e.g. after importing an archive, which removes the key, or after a restore to another device); otherwise the container keeps the attribute applied when the database was last opened. It always excludes Documents, `temp_files` and `.bak` copies ([`excludeNonAppDataFromBackup()`](../SimpleXChat/FileUtils.swift)). While protected data is unavailable (the device is locked) it does nothing, and the attributes applied before stay.
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ An unencrypted database with a non-random passphrase flag is possible: archives
|
||||
|
||||
"Chat backup" section in Settings → Chat data → Database passphrase & export, between "Chat database" and "Run chat", with the "Enable iCloud backup" toggle (`DEFAULT_ICLOUD_BACKUP`, off by default; the choice persists).
|
||||
|
||||
The app group container is included in backup when the toggle is on and `iCloudBackupBlock` returns `nil`. Otherwise the toggle is disabled and shown off, and the footer states the reason:
|
||||
The app group container is included in backup when the toggle is on and `iCloudBackupBlock` returns `nil`. When `iCloudBackupBlock` returns a reason, the toggle is disabled and shown off (it shows the container's actual state, so in the share-extension gap below it can still show on), and the footer states the reason:
|
||||
|
||||
| Reason | Footer |
|
||||
|---|---|
|
||||
|
||||
Reference in new issue
Block a user