deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.11k stars 144 forks source link

save chatmail diskspace by tweaking autodelete-from-server #3147

Closed r10s closed 3 months ago

r10s commented 3 months ago

this PR aims to help saving disk space on chatmail servers by deleting messages at once after download for new profiles (new profiles are usually not multi device, and multi device is the only reason to keep messages longer).

when we later get a hint that the user might set up a second device, we go back to automatic/never - which was the default up to now.

we assume that we will save 90% or more space by that as many user never set up a second device.

this PR also makes the available options a bit clearer (only two are left for chatmail, normal server still have opions as week/month/year) and adds a warning when an option may break multi device:

moreover, for chatmail the the alarming confirmation dialog is removed - there is anyways an auto-deletion and hints as "Do not use this function if you want to keep data on the server" and "Do not use this function if you are using other e-mail clients besides Delta Chat" are not matching and not doable for chatmail.

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

iequidoo commented 3 months ago

Btw, this option (DeleteServerAfter) isn't synced across devices in Core, seems this was forgotten.

iequidoo commented 3 months ago

Also i checked the core code, for DeleteServerAfter we count time from the sort timestamp which is derived from the "sent" timestamp, so we delete messages earlier than "X hours after fetch", but as there's the word "least" maybe it's not that important.

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

r10s commented 3 months ago

the PR does a little more than changing only the wording now, i adapted the PR description accordingly

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

hpk42 commented 3 months ago

Great stuff. The warning message is too implicit though. It's better to assume the reader has already forgotten what they tapped a second ago. So "turn on at-once deletion" as title and something like "if you enable at-once deletion you can not use multiple devices on this profile anymore"

r10s commented 3 months ago

yeah, your text suggestion is much better. i added a commit and also changed the screenshot in the PR description.

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk

adbenitez commented 3 months ago

I think this is missing resetting the delete at-once when backup transfer is finished in BackupProviderFragment

also if user does a normal backup, the device will keep deleting immediately despite the other device (that will be the one with deletion reset)

or is this "delete_server_after" synchronized via chatmail server special support?

EDIT: never mind, I somehow overlooked it, it is already done

r10s commented 3 months ago

also if user does a normal backup

idea is that the "never/automatic" is set on export as well as on import

or is this "delete_server_after" synchronized via chatmail server special support?

no

github-actions[bot] commented 3 months ago

To test the changes in this pull request, install this apk: 📦 app-preview.apk