deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

init/adapt `delete_server_after` for chatmail profiles

Open r10s opened this issue 1 year ago • 1 comments

to save diskspace on chatmail servers, we experimented at https://github.com/deltachat/deltachat-android/pull/3147 with the assumption that the vast majority of newly created accounts is never used in multi-device scenario. however, multi-device is the only reason for keeping things on servers after once downloaded.

therefore, we did the following tweaks to save diskspace:

  • set delete_server_after to "at once" for new chatmail profiles.
  • set delete_server_after to "automatic" [^1] on any hints the user may use multi-device. again only for chatmail profiles.

"any hints" are:

  • when "add second device" is started (delete_server_after is changed before so the the recipient get the information as well)
  • a backup is exported or imported

the changes are done on android-only, see assumeMultiDevice() at https://github.com/deltachat/deltachat-android/pull/3147/files

however, as we want to have this functionality on iOS and on desktop as well, it makes sense to check if we can do this is core as well - i assume that should be doable easily.

[^1]: "automatic" is equal to "never" from the view of core, but from view of user, there is still deletion after some time. there is no need of UI to really know about deletion details, this gives chatmail operators room to tweak.
moreover, for chatmail accounts, we can assume that only the options "at once" and "automatic" are available in UI

r10s avatar Jul 29 '24 10:07 r10s

  • a backup is exported or imported

Btw, setting delete_server_after to "automatic" on a backup export is useful even for single-device, otherwise the backup is semi-useful because after a restoration the user wouldn't see new messages deleted by the device after the backup was done. This means that even for non-chatmail case we should warn the user if they have delete_server_after enabled.

iequidoo avatar Jul 31 '24 22:07 iequidoo