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/2wWLrajbtM23pfAMHNAYE5jDBx8Y
✅ Preview: https://replicache-git-grgbkr-sdd-mutation-recovery-robust-rocicorp.vercel.app
Problem If the Mutation Recovery process stops on the first error encountered. This means a single problematic db or client can prevent recovery of all other clients.
Solution Updates Mutation Recovery logic to be more robust against errors. If an error occurs recovering a particular client or db, the logic will now log that error, and continue trying to recover other clients/dbs.
Adding the above robustness requires the process to handle the Replicache instance being closed more explicitly. Previously the process would stop on the first error encountered due to the Replicache intance being closed. This change updates the logic to check if this Replicache instance is closed before processing each db, and each client inside each db, and exits early if this Replicache instance is closed.