core icon indicating copy to clipboard operation
core copied to clipboard

Drop unused acpeerstates table in a migration, and delete unused keys in housekeeping

Open missytake opened this issue 9 months ago • 3 comments

  • Operating System (Linux/Mac/Windows/iOS/Android): Debian 12
  • Core Version: 1.158.0
  • Client Version: deltachat-rpc-client 1.158.0

Expected behavior

Bots have to be able to forget about a contact for privacy reasons. After a contact is removed from all chats, it can be deleted. I'd expect it to be deleted from all database tables.

Actual behavior

The email address and the public key remain in the acpeerstates table, and maybe also in other database tables (I don't have a good way to check all tables, is there a command for that?)

Steps to reproduce the problem

  1. Create new Alice + Bob profiles
  2. Send a message from Bob to Alice
  3. In Alice's account, delete the 1:1 chat with Bob
  4. In Alice's account the Bob's contact
  5. In an sqlitebrowser or similar software, run select * from acpeerstates; in Alice's dc.db file

missytake avatar Apr 07 '25 08:04 missytake

acpeerstates table is not used anymore in 2.x releases. We can drop it in a migration.

Keys, even unused ones, are now stored in public_keys table. It is likely safe to delete the key when we delete the key-contact, and also cleanup old unused keys during housekeeping.

link2xt avatar Oct 04 '25 05:10 link2xt

Since this requires a migration, this should be based on https://github.com/chatmail/core/pull/7116 (which itself is blocked on having a release on all platforms)

Hocuri avatar Oct 13 '25 13:10 Hocuri

While we are dropping old tables, can as well drop jobs, old_keypairs and sending_domains table.

link2xt avatar Oct 31 '25 14:10 link2xt