I don’t know if this a bug or works as intended but when we have a subscription and meteor disconnects upon reconnect it doesn’t trigger onReady callback on that subscription. I can see added and ready ddp messages but the callback itself is not called. Am I missing something?
have you try onReconnect
I am using onReconnect and set there a flag that data is being loaded (just as in normal conditions it is set when subscribing). Once onReady is called that flag is set to false so I know any new added element is new. However when reconnecting even though subscription is reinstated and I see that DDP ready messages is being received onReady callback on that subscription is not invoked and though my flag is never reset. I worked around that by subscribing again in onReconnect, but I think it should simply invoke onReady callback.
do you have a reproducible repository that we can debug and fix the issue?
Just a new “meteor create” will do it. Choose full example and modify for example this subscription with console.log:
Template.info.onCreated(function () {
Meteor.subscribe(‘links.all’, () => {
console.log(“On ready”)
});
});
When you start app “On ready” message is logged. Then do Meteor.disconnect() in browser console followed by Meteor.reconnect(), and no “On ready” is logged even though if you check DDP messages you can see links documents added again and “ready” ddp message for subscription is received.