# When are JSON entries removed from dc.db?

**URL:** <https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355>\
**Category:** Mutual Help\
**Created:** [November 16, 2025, 7:17pm UTC](https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355 "2025-11-16T19:17:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DELTA\_MAFIA](https://forum.delta.chat/user_avatar/forum.delta.chat/delta_mafia/32/2624_2.png) [@DELTA\_MAFIA](https://forum.delta.chat/u/DELTA_MAFIA)\
**Post date:** [November 16, 2025, 7:17pm UTC](https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355/1 "2025-11-16T19:17:10Z")

</div>

I want to clarify the behavior of WebXDC data in the Delta Chat database (`dc.db`).  
Each `sendUpdate()` creates a separate row in the `msgs` table with the update data (including base64 images) stored in the `json` field.

The question is:  
under which events should these rows be deleted, and are they deleted at all?

For example:

- are WebXDC rows deleted after deleting a chat?
- are they cleared after removing the webxdc app?
- does cleanup happen only after VACUUM or some internal processes?
- or do these rows remain forever and are never cleaned up automatically?

I want to understand the actual behavior of Delta Chat:  
Do WebXDC data ever get deleted automatically or not? And if yes, under which user actions?

---

<div class="post-metadata">

**Author:** ![WofWca](https://forum.delta.chat/user_avatar/forum.delta.chat/wofwca/32/1702_2.png) [@WofWca](https://forum.delta.chat/u/WofWca)\
**Post date:** [November 17, 2025, 2:10pm UTC](https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355/2 "2025-11-17T14:10:33Z")

</div>

So this is about messages that are sent with [`webxdc.sendUpdate()`](https://webxdc.org/docs/spec/sendUpdate.html), i.e., for example, the text that you put into [the Editor app](https://webxdc.org/apps/#webxdc-editor).

According to the following piece of code, these messages are removed periodically, on “housekeeping”.

> <https://github.com/chatmail/core/blob/c6ace749e3b465b92746434bff4ffaa180783f32/src/sql.rs#L891-L901>

It forms a list of all existing messages that are not in the “Trash” chat, and then deletes all the “WebXDC updates” that belong to a message that are not on that list.  
To put it simply, the intent is to delete these entries when the message that contained the `.xdc` file is deleted.

> [@DELTA\_MAFIA](#):
>
> are WebXDC rows deleted after deleting a chat?

Apparently yes, because all messages from a chat get deleted when a chat is deleted:

> <https://github.com/chatmail/core/blob/c6ace749e3b465b92746434bff4ffaa180783f32/src/chat.rs#L606-L639>

---

<div class="post-metadata">

**Author:** ![DELTA\_MAFIA](https://forum.delta.chat/user_avatar/forum.delta.chat/delta_mafia/32/2624_2.png) [@DELTA\_MAFIA](https://forum.delta.chat/u/DELTA_MAFIA)\
**Post date:** [November 17, 2025, 2:25pm UTC](https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355/3 "2025-11-17T14:25:33Z")

</div>

Alright, let’s say I have a task to maintain my own blog that consists of photos and text. With a large amount of data, in which case will the performance start to drop — if I keep it just in the chat, or in a webxdc app?

---

<div class="post-metadata">

**Author:** ![system](https://forum.delta.chat/uploads/default/original/1X/d435ee2a3c515521f06387caee1b32a67e183f89.jpg) [@system](https://forum.delta.chat/u/system)\
**Post date:** [October 6, 2026, 10:02pm UTC](https://forum.delta.chat/t/when-are-json-entries-removed-from-dc-db/4355/4 "2026-10-06T22:02:55Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
