Closed KyneSilverhide closed 7 years ago
Ok, my fault...
I'm very new to Meteor, and I didn't understood subscriptions properly. When subscribing to multiple subscriptions on the same collections, data is put into the "client minimongo". So I have to manually filter after calling the subscirption, otherwise I will get the "union" of both subscriptions.
It works properly now
const developersSub = Meteor.subscribe('developers.by.team', teamId);
...
const developers = Developers.find({ 'teamId': teamId }).fetch();
Hello, I have this one strange bug I can't really understand..
My components are like this
DevPage is the root page, TeamDevList is a component that displays all the developers in a collection that are assigned to the selected team, AllDevList is a sub component to manually add developers to the list. Modal is just a React Bootstrap modal. My containers have the same name as the components, but in two different folders.
AllDevList
TeamDevList
Now, whenever a click on the "Show modal" button to display the whole list... both subscriptions are updated and both show the same list. The team parameter gets ignored. I've added a debug in both containers, and they return the same list of developers, even if these are two different subscriptions. This only occurs when both subscriptions are linked to the same collection.
I guess I somehow need to "stop" or "unsubscribe" somewhere in the code, but I can't find how, and where.