deltachat-core-rust
deltachat-core-rust copied to clipboard
Deleted messages reappear
Messages that are deleted within 10 seconds of being sent will reappear. The bug occurs in both DC-iOS 1.34.1 (iOS 15.7) and DC-Desktop 1.33 (macOS 12.6). It doesn't matter whether "Send copy to self" is activated. Unfortunately I couldn't test DC-Android.
This is because message copy is sent to self via Bcc. If you delete the message quickly, DC completely forgets about it. When it arrives in the Inbox, it looks as if the message was sent from another device.
Is it a problem in practice?
I have an idea of implementing message deletion via moving the messages to Trash folder from which the messages will be actually removed a week later. This way this problem will not appear and deletions could be synchronized across devices, just like we synchronize the "seen" state. But this is more of a feature request for wishlist, not something I'm working on currently.This proposal does not actually solve the problem, because we need the message to arrive in the Inbox and it may never arrive.
Is it a problem in practice?
No, this is a small bug that doesn't play a big role in practice.
This is because message copy is sent to self via Bcc.
That's what I thought too at first. But why does the bug also occur when "Send copy to self" is disabled?
Which email provider do you use? Gmail saves copy in the Sent folder even if you don't Bcc-self, maybe you use Gmail or your provider does the same?
I mainly use GMX. You're right. It depends on the provider. I just tested iCloud-Mail and Mail.de. The problem does not occur there. Thanks for the information.
I still don't fully understand how this happens, so could be a bug. When you delete the message, it is not deleted immediately, but is moved into the "trash" chat first. This prevents redownloading the message with the same Message-ID, even if it appears on the server later. Trash entry is only removed during "housekeeping".
Could you reproduce the issue with GMX and send the log collected immediately after receiving a message?
I reinstalled DC-iOS in between and now the bug only occurs when "Send Copy to Self" is enabled or I send myself a message in "Saved Messages". Also only with GMX and Web.de. This confirms your first explanation?
I suspect that this is caused by triggering housekeeping here, which almost immediately removes the tombstone that normally prevents redownloading of BCC-self: https://github.com/deltachat/deltachat-core-rust/blob/f930576fd1a2feef981cbaa2e691f52bb66d2582/src/message.rs#L1474-L1477
We shoud ensure that tombstones are never deleted too early and kept for at least a day.
The first step is of course to reproduce this with a Python test.
This issue does not occur with Chatmail accounts. I suspect it's simply due to the higher speed and the fact that the emails don't have to be moved to the DC folder. I sometimes use the "Saved Messages" folder from DC to transfer the content of the clipboard from one device to another in encrypted form. It was always a bit annoying that the messages would pop up again if I deleted them too quickly. So it's basically a nice additional feature of Chatmail. :-)