rocicorp / replicache

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

fix: Fix flakiness of replicache-persist.test.ts on Webkit #828

Closed grgbkr closed 2 years ago

grgbkr commented 2 years ago

Problem replicache-persist.test is flacky on webkit because the persist process does not always complete before we create a new replicache and try to read the persisted data. This happens more on webkit because it uses a timeout rather than request idle callback to start persist.

Solution Wait for persist to complete (detected by polling the ClientMap) before creating a new Replicache and verifying it bootstraps from the persisted data.

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/ERHX1U3sVmt4bxQFD4KpeZ9hLnzX
✅ Preview: https://replicache-git-grgbkr-persist-flakiness-rocicorp.vercel.app