Closed willoughby closed 9 years ago
Mmh, that is strange indeed. I see no reason why the code shouldn't work without the re-run of the query.
I can tweak the read attr in the db and it works as you expect
Again, strange. :-) Maybe the call to the clearNotification
method is not working. Try passing console.log.bind(console)
as third argument to the Asteroid
constructor and see if the server is actually sending you the change notification.
It looks like the data change isn't being picked up
Object {type: "socket_message_sent", message: "{"msg":"method","id":"33","method":"clearNotification","params":["QXrYGN6giczesiKvY"]}", timestamp: 1418647754694}
ddp.js:302 Object {type: "socket_message_received", message: "{"msg":"result","id":"33","result":1}", timestamp: 1418647754779}
ddp.js:302 Object {type: "socket_message_received", message: "{"msg":"changed","collection":"Notifications","id"…","fields":{"updatedAt":{"$date":1418647746944}}}", timestamp: 1418647754783}
The server method being called is:
'clearNotifications': ()->
Notifications.update({"userId":Meteor.userId(),"read":false},{ $set: { read: true }},{multi:true})
Mmh, that is strange, but it seems to be a server problem. I'm wondering, are you publishing the read
property of Notifications
?
Was it solved? Closing for cleanup, reopen if necessary.
I have a query like notifications.reactiveQuery({"read":false}), which returns records fine, when a record read attr changes to true (via a meteor.call 'clearNotification'), the query doesn't seem to catch the change. my current workaround is to rerun the query in the updated promise from my meteor.call method
I can tweak the read attr in the db and it works as you expect. not sure if its something i'm missing ?