-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete database not deleted after restore failure #4307
Comments
To add: Even though the database has not been restored completely, new emails that were delivered to the Inbox before have been fetched right on, and I can see the notifications for them layed over the welcome screen. (The matter in this case was not too less disk space, of course.) |
This is not fixed yet, moving to the core. |
FYI , this seems to be solved, but the core issue, this one, is still valid. |
So this is still an issue, if backup restore fails, the account with incomplete database is started anyway and user starts receiving notification even thought the backup is broken. |
FYI, I have stumbled over that issue once again just recently. |
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all, but let's postpone changing this for now.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all, but let's postpone changing this for now.
@iequidoo I have looked at #5086, but as there are no tests it is not clear if it is an improvement. A fix for this issue I can imagine is to make account import/export a function of account manager, so account manager can unpack an account and only plug it into So "unconfigured" account probably should stay, but maybe think in terms of importing an account into a separate temporary folder and then replacing old account folder with a new one? |
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all, but let's postpone changing this for now.
I also thought in this direction, but it looked complicated to me and i decided just to improve the existing code. Although there are no tests yet (so it may degrade easily), i think that for now it can be useful:
I could try to implement this as the next step. |
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after a restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
This way we can't get an account with missing blobs if there's not enough disk space. Also delete already unpacked files if all files weren't unpacked successfully. Still, there are some minor problems remaining: - If a db wasn't imported successfully, unpacked blobs aren't deleted because we don't know at which step the import failed and whether the db will reference the blobs after restart. - If `delete_and_reset_all_device_msgs()` fails, the whole `import_backup()` fails also, but after a restart delete_and_reset_all_device_msgs() isn't retried. Probably errors from it should be ignored at all.
Not sure this may be closed, now i don't understand who should call |
Android version:
Android 11.
Device:
Fairphone FP2 (Lineage OS 18.1 build RQ3A.211001.001 from 2022-04-22).
Delta Chat version:
1.29.1 (nightly built 2022-04-24).
Expected behavior:
During setup: After the database restore process has failed due to insufficient disk space (OS error 28), the incompletely restored database is deleted from the device.
Actual behavior:
During setup: After the database restore process has failed due to insufficient disk space (OS error 28), the incompletely restored database is not deleted from the device.
Steps to reproduce the problem:
-- Restore a previously backed up database on a device with very low disk space to make the error occur.
Screenshots:
N/A.
Logs:
N/A.
Remark:
I have no clue whether it makes a difference if a database is restored during setup or in "Preferences" in this regard.
The text was updated successfully, but these errors were encountered: