I have been working on an offline app with ground:db, but I have an issue with cordova where the dpp connection is completely unstable.
Here is a simple example:
seyan:meteor_publish_test deeeed$ cat both.js
import { Meteor } from 'meteor/meteor';
Test = new Meteor.Collection("test");
if(Meteor.isServer) {
Meteor.publish("test", () => {
let cursor = Test.find();
console.log("publish cursor for test ");
return cursor;
});
}
if(Meteor.isClient) {
Tracker.autorun(() => {
console.debug("connected: "+Meteor.status().connected);
});
Meteor.subscribe("test");
}
seyan:meteor_publish_test deeeed$
As you can see on the screenshot, it keeps disconnecting and re-subscribing to the publication.
It is a big problem for me as I have a lot of data to load for an offline app, and I would like to limit the size of the data being transfered…
It doesn’t happen on desktop, I am not sure if there is a way to prevent this behavior ?
I was thinking to force Meteor.disconnect() after my data is grounded locally and only reconnect on a chosen interval to synchronize the data, but it really goes against meteor reactivity…
Any suggestions are very welcome
Thanks