When I delete a message containing an attachment from a chat (either for everyone or just for me) I expect the attachment to also be deleted from the database. However, I was doing some tests with both the Android and Desktop version and the user databases got quickly massive, although I deleted the messages from the chats.
It doesn’t make sense to still save the message attachments if they aren’t accessible to a regular user. It is not really hard to manually delete the messages from the Desktop version, but it is impossible to do so from the mobile app.
lk108
August 5, 2026, 7:00am
2
I think the attachments are deleted, just not directly, but in periodic (EDIT: once daily I think) “housekeeping” runs.
ian
August 5, 2026, 8:46am
3
Yes. More specifically, it will periodically try to remove unused files, but not within the same 24 hour period.
{
warn!(
ctx,
"Transport {transport_id}: Failed to resync UIDs: {err:#}."
);
imap.resync_request_sender.try_send(()).ok();
}
maybe_add_time_based_warnings(ctx).await;
match ctx.get_config_i64(Config::LastHousekeeping).await {
Ok(last_housekeeping_time) => {
let next_housekeeping_time =
last_housekeeping_time.saturating_add(constants::HOUSEKEEPING_PERIOD);
if next_housekeeping_time <= time() {
sql::housekeeping(ctx).await.log_err(ctx).ok();
}
}
Err(err) => {
warn!(
ctx,
match ctx.get_config_i64(Config::LastHousekeeping).await {
Ok(last_housekeeping_time) => {
let next_housekeeping_time =
last_housekeeping_time.saturating_add(constants::HOUSEKEEPING_PERIOD);
if next_housekeeping_time <= time() {
sql::housekeeping(ctx).await.log_err(ctx).ok();
pub(crate) const DC_BACKGROUND_FETCH_QUOTA_CHECK_RATELIMIT: u64 = 12 * 60 * 60; // 12 hours
/// How far in the future the sender timestamp of a message is allowed to be, in seconds. Also used
/// in the group membership consistency algo to reject outdated membership changes.
pub(crate) const TIMESTAMP_SENT_TOLERANCE: i64 = 60;
// To make text edits clearer for Non-Delta-MUA or old Delta Chats, edited text will be prefixed by EDITED_PREFIX.
// Newer Delta Chats will remove the prefix as needed.
pub(crate) const EDITED_PREFIX: &str = "✏️";
/// Period between `sql::housekeeping()` runs.
pub(crate) const HOUSEKEEPING_PERIOD: i64 = 24 * 60 * 60;
pub(crate) const BROADCAST_INCOMPATIBILITY_MSG: &str = r#"The up to now "experimental channels feature" is about to become an officially supported one. By that, privacy will be improved, it will become faster, and less traffic will be consumed.
As we do not guarantee feature-stability for such experiments, this means, that you will need to create the channel again.
Here is what to do:
• Create a new channel
• Tap on the channel name
• Tap on "QR Invite Code"
/// Period between `sql::housekeeping()` runs.
pub(crate) const HOUSEKEEPING_PERIOD: i64 = 24 * 60 * 60;
.await
.context("Failed to cleanup HTTP cache")
.log_err(context)
.ok();
migrations::msgs_to_key_contacts(context)
.await
.context("migrations::msgs_to_key_contacts")
.log_err(context)
.ok();
if let Err(err) = remove_unused_files(context).await {
warn!(
context,
"Housekeeping: cannot remove unused files: {:#}.", err
);
}
if let Err(err) = start_ephemeral_timers(context).await {
warn!(
context,
"Housekeeping: cannot start ephemeral timers: {:#}.", err
if let Err(err) = remove_unused_files(context).await {
Ohhh, okay! My bad, then, for being an impatient
Although it is not obvious for most people, I understand it’s not a big deal, and it makes more sense from a resource viewpoint.
Thanks!!
WofWca
August 6, 2026, 8:28am
5