Bad UX when trying to import an old backup from a file
By increasing DCBACKUP_VERSION, we can make sure that an error will be shown when the user tries to import a new backup into and old Delta Chat version.
This works very nicely for Add-second-device, but for import-file, there are two problems:
- Even though an error message is shown, the profile is still imported, and accessible via the account switcher.
Instead, the profile should be deleted if
DCBACKUP_VERSIONis too new. - The error message shown is cryptic, and not localized:
| Add-second-device | Import-file |
|---|---|
Can you provide an outdated backup for testing?
- Even though an error message is shown, the profile is still imported, and accessible via the account switcher. Instead, the profile should be deleted if DCBACKUP_VERSION is too new.
From what I saw, import_backup merely attaches the database from the backup file and not more. The frontend handles account creation (at least in the desktop case) and then imports a backup, so I see the responsibility to remove that broken account from the list on the frontend. One way to remove it in core would probably be to call Accounts::remove_account, but the context does not know about the account manager.
Can you provide an outdated backup for testing?
We recently increased DCBACKUP_VERSION: https://github.com/chatmail/core/pull/6929. So, just export a backup with current main, and try to import it into a released version of DC