I’m having this weird problem. I have a subscription set up inside of autorun, and if I console.log sub.ready() it never gets to true - but only in Cordova on a physical device. It’s fine on the simulator or in a browser.
Additionally, if I add an onReady handler to the subscription, that returns fine, and I can even grab the data I want through Coll.find(), but Tracker still never sees the ready change.
Even more strangely, if I trace out the autorun handler inside of onReady, sometimes it actually works…
I’ve tried a bunch of different configurations, including using SubsManager, and not, rearranging things, putting everything inside the autorun function, moving some stuff around, nothing seems to reliably fix this problem.
Has anyone else noticed reliability problems with autorun subscriptions inside Cordova?
// track the grid
autoruns [gridSlug] = Tracker.autorun (function () {
// subscribe to the grid publication for gridSlug (must be in autorun)
const gridSub = gridSubs.subscribe ('grids', gridSlug, {
onStop (error) {
console.log(error)
},
onReady () {
console.log(gridSub.ready(), Grids.findOne ({ slug: gridSlug }))
console.log(autoruns [gridSlug])
}
})
console.log (gridSub.ready()) // almost never true in corodova on a device
})
This was happening in various versions of Meteor 1.3, including 1.3.3
Kevin N.