session-foundation / session-android

A private messenger for Android.
https://getsession.org
GNU General Public License v3.0
32 stars 4 forks source link

the deleted messages are never deleted #603

Closed gilojimjim closed 2 years ago

gilojimjim commented 3 years ago

The deleted messages in the signal.db database on the Session Android (/data/data/network.loki.messenger/database/signal.db) are NEVER deleted. they are marked deleted but are always stored in the signal.db (the database is still growing)

you should use the sqlite VACUUM command each time the Session Android is run, to delete the old messages in the database.

https://sqlite.org/lang_vacuum.html

jimgillo commented 3 years ago

Many users never stop their phone and leave the application still open. You shoudl add in your code:

pragma secure_delete=on

For erased messages to be deleted in any case.

hjubb commented 2 years ago

Sqlcipher should be using the secure_delete flag since before this issue was raised, which we use underneath. We'll use the vacuum command on startup from a pending performance build shortly which will also free the already securely deleted contents so it will reduce the overall DB size