TryQuiet / quiet

A private, p2p alternative to Slack and Discord built on Tor & IPFS
https://www.tryquiet.org
GNU General Public License v3.0
1.98k stars 86 forks source link

Store decrypted messages locally in an indexable db #2635

Open adrastaea opened 1 month ago

adrastaea commented 1 month ago

Description

To avoid decrypting messages multiple times, we should cache decrypted messages locally. This is a good opportunity to move message logic from sagas to the backend as well. We should keep a queue of received encrypted messages and pop them once they are decrypted and put in the local store. We should also set the decrypted message store up so that we can easily add storage windows based on storage sizes or time ranges so that users can effectively manage local data sizes. :NOTE: this is already given to us for free because we already push messages to the redux store which I think pushes this to non-essential path work. But this is a good ticket for later work to make the decrypted message base work more like a queue/cache and add search functions later.

Acceptance Criteria

  1. Encrypted messages received are pushed to a queue.
  2. Decrypted messages are pushed to a persisted local cache (sqllite?)
  3. Messages are displayed from the cache