Hello,
Tracker is not reacting to collection inserts.
Server code:
if (Meteor.isServer) {
Meteor.publish('sites', function () {
if (!Meteor.userId()) {
Meteor.Error('not-authorized', 'You must be logged in to view this data')
}
return SitesCollection.find()
})
}
Client code:
Tracker.autorun(() => {
console.log('[TRACKER] Update')
const subscription = Meteor.subscribe('sites')
if (!subscription.ready()) {
console.log('[TRACKER] Sites subscription not ready.')
return
}
const data = SitesCollection
.find({ 'zone._id': workingZone() }) // Solid.JS signal
.fetch()
console.log('[TRACKER] Sites data:', data)
setSitesRows(data) // Solid.JS signal
setReady(true) // Solid.JS signal
})
The tracker function is run only once. If I insert a new Site using a server Meteor method, the document is inserted normally, but the Tracker does not react. The same code works perfectly in Meteor 2.15.
If I trigger another find/fetch, with a button for instance, the inserted document appears, so the pub/sub is working. It’s just the Tracker is not reacting.
Any pointer, very welcomed.