rocicorp / replicache

Realtime Sync for Any Backend Stack
https://doc.replicache.dev
1.05k stars 37 forks source link

fix: fix benchmarks broken by mutation recovery change #808

Closed grgbkr closed 2 years ago

grgbkr commented 2 years ago

These were broken by 1538c424e2369c36c5a41c7876f0dad338e59768.

three fixes.

  1. close other indexeddbs we try to recover
  2. delete IDBDatabasesStore indexeddb db after each benchmark. this way mutationRecovery is not try to recover a ton of dbs during benchmarks.
  3. make the indexeddb deletion code in perf tests more robost. There is no way to wait for an indexeddb close to complete (the api is silently async). If you call delete when a close is in process, it fails with a onblocked event. Add code that will delay 100ms and then retry delete after a onblocked event (up to 10 retries).
vercel[bot] commented 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/8uxVQ8jcFfBNDuvw8ymbb3wdSUFv
✅ Preview: https://replicache-git-grgbkr-sdd-mutation-recovery-fix-d95532-rocicorp.vercel.app