Skip to content

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Aug 24, 2025

Helps #7115.
Not sure about the second commit because it breaks the scenario described in ephemeral.rs:

//! When Delta Chat deletes the message locally, it moves the message
//! to the trash chat and removes actual message contents. Messages in
//! the trash chat are called "tombstones" and track the Message-ID to
//! prevent accidental redownloading of the message from the server,
//! e.g. in case of UID validity change.

But the first one shouldn't make harm even for Gmail (tested it with my account with "Watch Sent Folder" set) which copies sent messages to Sent because if the user deletes the message, either it has already appeared on both mailboxes or hasn't really sent yet, i.e. it's quite hard to catch a race and see that the message reappears after deletion, at least i haven't succeeded with this.

@iequidoo iequidoo force-pushed the iequidoo/one-shot-tombstones branch 3 times, most recently from e670205 to 18dede1 Compare August 25, 2025 15:19
@iequidoo iequidoo changed the title fix: Prune tombstone when a message isn't expected to appear on IMAP anymore (#7115) Receiving of re-sent deleted messages (#7115) Aug 25, 2025
@iequidoo iequidoo force-pushed the iequidoo/one-shot-tombstones branch from 18dede1 to ca5b098 Compare August 25, 2025 17:13
…anymore (#7115)

This allows to receive deleted messages again if they're re-sent:
- After a manual deletion,
- If both DeleteServerAfter and DeleteDeviceAfter are set,

w/o waiting for 2 days when stale tombstones are GC-ed. This is particularly useful for webxdc. If
only DeleteDeviceAfter is set though, this changes nothing and maybe a separate fix is needed.

This may also greately reduce the db size for some bots which receive and immediately delete many
messages.

Also insert a tombstone to the db if a deletion request (incl. sync messages) can't find
`rfc724_mid`. This may happen in case of message reordering and the deleted message mustn't appear
when it finally arrives.
Before, locally deleted messages (because of DeleteDeviceAfter set or external deletion requests)
couldn't be received if they're re-sent because tombstones prevented that forever. This led to
locally deleted webxdcs being unrecoverable.
@iequidoo iequidoo force-pushed the iequidoo/one-shot-tombstones branch from ca5b098 to 308044e Compare August 26, 2025 12:38
@iequidoo iequidoo requested review from link2xt and Hocuri August 26, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant