We are building a realtime webapp on sails 0.10.5. We have a lot of models linked through associations. For example we have a User model and a Post model, where a post always has one user.
The populate
makes sure that when fetching a user, we also get the posts. We tell the (websocket) client about updates using the subscribe
and watch
model methods in our sails controllers.
However whenever a websocket client is watching both the User model (watch
and subscribe
d to all users) and the Post model (watch
). And a new Post gets created (via another socket for example) our client only receives a new event for Post, while the User changed as well (indirectly through an association).
How can we make sure our clients get those updates as well? Basically we need a way to sync the results of any populated model to our clients.