rocicorp / replicache

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

Data not persisting through refreshes #1049

Closed lukerep closed 1 year ago

lukerep commented 1 year ago

Just got replicache up and running, everything appears to be getting/setting correctly but as soon as I refresh the page nothing is persisted.

Running in NextJS and utilising the replicache-react package too.

Can see that data is being written to IndexedDB with rep:<user> so I'm not sure what is wrong.

Any ideas?

aboodman commented 1 year ago

Have you hooked Replicache up to a server yet? It is expected that you will not see data across refreshes without server acknowledgment in Replicache 12. See https://doc.replicache.dev/concepts/offline.

In Replicache 13 (releasing soon) this is fixed. If you are interested you can try the Replicache 13 beta by following the docs here:

https://trunk.doc.replicache.dev/

If the problem is not that the server isn't acknowledging, another cause could be using a different user on every page load.

Let me know if either of these help.

lukerep commented 1 year ago

No I haven't hooked it up to a server yet, thanks for pointing that out.

I'll have a look at Replicache 13, thanks!