Meteor disconnect automatically wiped off all collections in minimogo

Once the DDP connection is lost and get reconnected, all data in the minimongo get wiped off.

I found when the connection is lost, the status is “offline”, all data in minimongo remains.

However once call ddo.reconnect(), all the data will be wiped off.

How can I prevent this behavior from happening?

Do you have a reactive variable in your subscriptions ?
Are you using grounddb ?

I don’t have any subscription and actually I didn’t use them. The server will just send data down when needed.

Nope! Server does not just send down data. Pubs/subs is how server send data to client. If you don’t have any pubs/subs than you still have autopublish and insecure packages. Those packages are for prototyping, not for production.

I mean we implemented our own mechanism to send down data and nor depend on default pub/sub.

My question is meteor will clear minimongo after reconnect and want to find a solution to prevent that from happening.

This is a similar question in Stack Overflow:

When the connection is lost minimongo data remains in memory. If the connection comes back the data should still be there. However, if you’ve reloaded the browser, then you will have cleared memory. Similarly, if you’ve logged out and have user-specific subscriptions, minimongo will be updated and those documents will be removed.

That means the user has disconnected (as opposed to a connection error):

status String
Describes the current reconnection status. The possible values are connected (the connection is up and running), connecting (disconnected and trying to open a new connection), failed (permanently failed to connect; e.g., the client and server support different versions of DDP), waiting (failed to connect and waiting to try to reconnect) and offline (user has disconnected the connection).

I don’t know what this means. There is a Meteor.reconnect() and and a reconnect method returned from the DDP.connect() method: https://docs.meteor.com/api/connections.html#DDP-connect

No, it doesn’t do that. It may reload the documents after reconnect in case publication is per user but it shouldn’t be the case for you as you don’t use pubs/subs.