open-chat
open-chat copied to clipboard
disambiguate and encrypt cached data
We need to consider the scenario where multiple different users use the same device. In this scenario we need to ensure that the cached data on the client is a) isolated and b) secure. For this the data must be sharded according to some unique property of the user e.g. their Principal and it must also be encrypted (how to do that - TBD).
Looks like we might be able to encrypt index db using dexie and dexie-encrypted.
Note, that it is probably not necessary to shard messages / events since they are keyed by chatId anyway. We will need to shard chats by userId though. Both stores still need to be encrypted though.