rocicorp / replicache

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

Database is closing error in heartbeat #843

Closed arv closed 2 years ago

arv commented 2 years ago

It is common to close and reopen a db quickly (in react hot module reloading for example) but that leads to issues with the db being in the process of being closed.

Before SDD we had a way to detect this by awaiting the closing promise when we open the db again. I think the _perdag db is not doing this as we expect any more leading to this error.

See https://discord.com/channels/830183651022471199/942807273300955187

grgbkr commented 2 years ago

I'm having difficulty reproducing.

I created a local version of Replidraw that has basically the same useEffect setup for creating/closing Replicache as in this gist from the report over Discord. This did not manifest the problem.

aboodman commented 2 years ago

I couldn't reproduce this either by applying Greg's patch to Replidraw. I did verify that the close call is running.