It is possible that Meteor mixes data of users?



I have made an app that sends your contact book to the server, checks if the phone numbers are users, and returns an array of registered users.

Today I opened the app at the same time than a friend, and he had on his phone the list of my contacts at first. And then when he refreshes the list, he gets his own contacts.

Is it possible that Meteor returns data to the wrong user?


Sounds more like your app sending the wrong data. Impossible to tell without seeing code.


I still have the autopublish package on. Could it be the reason?


Yes, autopublish could be the problem.

If you are filtering the data on the client, your server is still sending unfiltered data, meaning that you and your friend both have access to all of the data. You will need to turn off autopublish, and create publications and subscriptions in order to limit the data that each of you has access to.


I think I understand what happened.

I create a first list on the client will all contacts, then I call a method on the server.
The method create an array on the server filtering the phone numbers which are in the database.

I think that when the app is started on 2 phones simultaneously, they both call this method, but the 2 occurrences deal with the same filtered array.
Is this possible?

Then I guess I have to give a unique name to the array created on the server…


As @vigorwebsolutions already said, you should remove the autopublish package and create your own publications. Maybe this solves the problem.