Drop unused acpeerstates table in a migration, and delete unused keys in housekeeping
- 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
- Create new Alice + Bob profiles
- Send a message from Bob to Alice
- In Alice's account, delete the 1:1 chat with Bob
- In Alice's account the Bob's contact
- In an sqlitebrowser or similar software, run
select * from acpeerstates;in Alice's dc.db file
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.
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)
While we are dropping old tables, can as well drop jobs, old_keypairs and sending_domains table.