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

deleting last chat left artifacts behind on server

Open testbird opened this issue 6 years ago • 11 comments

After deleting the last chat, all chats were gone on the device, but the DeltaChat folder on the server was still there, and it still contained some of the messages. (Possibly ones that were sent by the device and uploaded through imap.)

Tested with a new install (v0.18.2)

  • enabled qr lab functions
  • scanned a qr
  • exchanged a couple of messages
  • manually deleted what looked like the handshake-messages in INBOX
  • deleted last two text messages in deltachat, but then decided to delete all messages by deleting the whole chat.

testbird avatar Jul 12 '18 13:07 testbird

just to note:

  • deleting the chat does not delete the messages
  • the DeltaChat folder is never deleted

r10s avatar Jul 12 '18 13:07 r10s

Do I understand you correctly? Your points summarize the things that are not yet done, but would make deltachat behave nicely and solve the inconsistency with deleting individual messages.

Perfect. :)

testbird avatar Jul 12 '18 13:07 testbird

no, i just want to summarize the current state. i do not really get what this issue is about :)

r10s avatar Jul 12 '18 14:07 r10s

It's about DC not consistently cleaning up again.

-> Deleting (contained) messages on the server, when deleting a complete chat. And removing the chat folder if the last chat message is deleted .

testbird avatar Aug 28 '18 12:08 testbird

delta chat leaves messages as a backup on the server if the chats are deleted.

i do not think that it is a big issue when the DeltaChat folder is not deleted if Delta Chat is uninstalled - even if we decide to add an option to delete complete Chats also from the server, imho this will always be optional, so if Delta Chat is used for more than five minutes, there is a very good chance that there are messages in the DeltaChat folder that are no longer under control of DeltaChat.

wrt handshake messages of the labs feature: you are right, they should not hang around somewhere, however, iirc think they are cleaned up "better" meanwhile.

r10s avatar Sep 07 '18 09:09 r10s

This issue reveals inconsistencies in the deltachat-core code to manage messages on the server. It's a bad sign. It ought to get fixed because such things tend to provoke errors and inconsistencies and distrubances in other places, for example when trying to maintain server storage space limits.

if Delta Chat is used for more than five minutes, there is a very good chance that there are messages in the DeltaChat folder that are no longer under control of DeltaChat.

Ugh, what? Shouldn't IMAP clients always list the messages on the server (and keep a local db of synced and archived messages)? If deltachat is not in control, the user can't be in control of the messages.

testbird avatar Sep 08 '18 12:09 testbird

just imaging the user replies to a Delta Chat messages with his normal MUA and/or moves messages into the DeltaChat folder.

r10s avatar Sep 08 '18 16:09 r10s

I guess a new MUA reply could appear in the sent, inbox, and email chat folder. I imaginge deltachat adds it to the local database as a new message (in-reply-to), moves it to the chat folder if not there, and it would be deletable just as any other message.

In case the user does really copy some unrelated messages (emails not belonging to any chat) into the chat folder, i imagine only these would remain after the user deletes all chats in deltachat (in this case deltachat's attempt to delete the chat folder would correctly fail because it still contains the foreign artefacts).

testbird avatar Sep 08 '18 17:09 testbird

due to many changes (single-folder etc.) i would target this issue later.

r10s avatar Nov 06 '18 22:11 r10s

in general, i'm not sure, if it makes sense to keep chat-messages between device and sever in sync. there are several reasons why exactly this is not wanted.

however, the initially mentioned artefacts should be removed where possible. however, there are also some more concrete issues about them so maybe this one can be closed.

r10s avatar Mar 03 '19 11:03 r10s

References please. What reasons and issues are you talking about?

Another occurence of this issues problem of re-downloading / syncing of priorly deleted messages: https://support.delta.chat/t/workaround-make-new-delta-chat-installation-import-old-messages-from-imap-directory/262/6

testbird avatar Aug 17 '19 11:08 testbird