ground-db icon indicating copy to clipboard operation
ground-db copied to clipboard

Grounded DB cleared on poor connection.

Open thedracle opened this issue 8 years ago • 3 comments

I'm currently using GroundDB on tablets that are in various areas of connectivity on a 4G network.

What we are seeing is, if the tablet is offline, and a collection has been cached, everything works great.

If we have a tenuous 4G connection however, that makes a subscription, but the subscription is slow or never finishes, we end up with the DB getting cleared entirely. This means in the period between when the subscription starts, and when it receives 'ready', we have nothing in our collections.

The desired behavior would be for the cached data to be available until the new subscription is entirely ready, and especially for it to not lose all of the data in the event it happens to get a passing connection.

thedracle avatar Oct 07 '15 00:10 thedracle

you might need to control the clean up of local documents https://github.com/GroundMeteor/db#additional-api

raix avatar Oct 09 '15 09:10 raix

It sounds like from this description, and looking at the code, the situation I am describing shouldn't be possible?

I.E: Ground.ready() should only reactively update when the subscriptions have all received an online 'ready' event from the server, and have an entirely fresh accurate version of the remote data?

Are you aware of any situations where this might not be the case? Maybe the subscriptions are getting 'ready' in some other way?

I've disabled the local cleaning like you suggested, and I will try to make some very specific way of matching the local collection data to the new subscription.

thedracle avatar Oct 10 '15 21:10 thedracle

The sub ready wont catch Suns added late

raix avatar Oct 11 '15 05:10 raix