-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup hash_ratchet_encrypted_messages
periodically
#5036
Comments
This time with proper migration timestamp. part of: #5036
This time with proper migration timestamp. part of: #5036
This time with proper migration timestamp. part of: #5036
This time with proper migration timestamp. part of: #5036
This time with proper migration timestamp. part of: #5036
This time with proper migration timestamp. part of: #5036
@osmaczko have you opened an issue for this? |
Not yet. Since we introduced indexing and have cleanup on the horizon, I am unsure if it's worth it. Many things can go wrong; there might be paths where subscription is skipped, and we'll end up with hard-to-investigate bugs. |
Problem
The
hash_ratchet_encrypted_messages
table is utilized for storing messages that are unable to be decrypted. Currently, there is no mechanism in place for cleaning up this storage, particularly when the necessary encryption keys are not obtained. This lack of cleanup becomes problematic for clients who participate in communities but lack access to certain private channels, leading to uncontrolled and potentially infinite growth of the table. This growth adversely impacts performance, as the table is queried each time a hash ratchet is received, whether from store nodes or relays.SELECT count(*) FROM hash_ratchet_encrypted_messages
-> 653SELECT timestamp FROM hash_ratchet_encrypted_messages ORDER BY timestamp ASC LIMIT 1
-> 1709136641 (Feb 28 2024)Implementation
Clean up the
hash_ratchet_encrypted_messages
periodically. The condition would be: If a message remains unencrypted for 14 days, remove it.Acceptance Criteria
hash_ratchet_encrypted_messages
Notes
hash_ratchet_encrypted_messages.key_id
for immediate improvementFuture Steps
As a future improvement, we should not subscribe to chats (channels) we do not have permission for. This way, we would not be saving messages from private channels at all.
The text was updated successfully, but these errors were encountered: