core icon indicating copy to clipboard operation
core copied to clipboard

Bad UX when trying to import an old backup from a file

Open Hocuri opened this issue 6 months ago • 3 comments

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:

  1. 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.
  2. The error message shown is cryptic, and not localized:
Add-second-device Import-file
image image

Hocuri avatar Jun 21 '25 17:06 Hocuri

Can you provide an outdated backup for testing?

Septias avatar Jun 26 '25 13:06 Septias

  1. 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.

Septias avatar Jun 26 '25 14:06 Septias

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

Hocuri avatar Jun 28 '25 19:06 Hocuri