Closed grgbkr closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/rocicorp/replicache/37Z7auVsdMkULbGm1qFgBgHY3Pj8
✅ Preview: https://replicache-git-grgbkr-sdd-store-schema-versions-rocicorp.vercel.app
I really like how you are using the kv.Store to handle this. Beautiful!
Problem
We need to be able to find old Replicache IndexedDB databases (i.e. databases with previous schema versions or replicache format versions), so that we can recover mutations from them and also GC them.
Solution
Keep track of Replicache IndexedDB databases in a IndexedDB database.
Unfortunately Firefox does not implement IDBFactory.databases, or we would use that api.
IndexedDB is used over LocalStorage because LocalStorage's lack of concurrency control makes it very difficult to avoid write clobbering when updating a list or map.