deltachat / deltachat-core-rust

Delta Chat Rust Core library, used by Android/iOS/desktop apps, bindings and bots 📧
https://delta.chat/en/contribute
Other
669 stars 85 forks source link

webxdc updates are not deleted on chat or message deletion #4558

Closed r10s closed 1 year ago

r10s commented 1 year ago

examinating the database for $reasons, i came over that msgs_status_updates (webxdc updates) seem not to be cleaned up when messages or chats are deleted.

looking at the source, there is a MsgId::delete_from_db() but that is not called from ChatId::delete(). not totally sure for message::delete_msgs() as that schedules jobs, however, from examination of the database, also there webxdc updates are not cleaned up.

then running SELECT COUNT(*) from msgs_status_updates WHERE msg_id NOT IN (SELECT id FROM msgs); returned 640 "forgotten" rows (of 12602 in total) - fewer than i expected as by development i use webxdc quite extensive :)

maybe we can just do the cleanup in housekeeping() as done for msgs_mdns - that would also fix the issue for existing installations and simplify the code for MsgId::delete_from_db(). i think, there are also tests missing in that code part.

link2xt commented 1 year ago

Closed by #4565