From e6fcccc8bde60c84157e0a3adbae01b87c621b7a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 30 Apr 2020 22:42:56 +0200 Subject: Don't store pending receipts in cache We don't get notified for every message. Sometimes we only get a read receipt for the newest message, which means old read receipts accumulate in the database. This least to some considerable CPU overhead, when checking if the timeline should be notified for new read receipts. Instead just always notify, since that has far less overhead in the worst case and doesn't need complicated cache cleanup. The old pending_receipts db is not removed for now. It should still have minimal storage overhead and we don't have a good mechanism for cache format upgrades atm. --- src/Cache_p.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/Cache_p.h') diff --git a/src/Cache_p.h b/src/Cache_p.h index 6eae45a9..982099ea 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h @@ -137,18 +137,6 @@ public: using UserReceipts = std::multimap>; UserReceipts readReceipts(const QString &event_id, const QString &room_id); - //! Filter the events that have at least one read receipt. - std::vector filterReadEvents(const QString &room_id, - const std::vector &event_ids, - const std::string &excluded_user); - //! Add event for which we are expecting some read receipts. - void addPendingReceipt(const QString &room_id, const QString &event_id); - void removePendingReceipt(lmdb::txn &txn, - const std::string &room_id, - const std::string &event_id); - void notifyForReadReceipts(const std::string &room_id); - std::vector pendingReceiptsEvents(lmdb::txn &txn, const std::string &room_id); - QByteArray image(const QString &url) const; QByteArray image(lmdb::txn &txn, const std::string &url) const; void saveImage(const std::string &url, const std::string &data); -- cgit 1.5.1