Chat-id (key) is different for snapshot inside IndexedDB and chat which is creating. Perhaps this is the reason that snapshot is not getting deleted from IndexedDB even after chats history are deleted.
Hey thanks for catching this, I have just submitted a PR to fix this.
2 Likes
Hi, i have one more question
can you please tell me reason to store the snapshots in IndexedDB instead of local Storage ?
What’s the benefit of doing this ?
Theres a few reasons for this mainly:
-
localStorage is synchronous and blocks the main thread. This means reading/writing large data could make the UI janky or unresponsive.
-
IndexedDB is fully asynchronous, so it won’t freeze the app when reading/writing data.
-
IndexedDB can query by timestamp, key etc.
-
localStorage cant, you have to load everything into memory and filter manually.
1 Like