inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)
MIT License
693 stars 210 forks source link

DDP "removed" called on startup #332

Open dnish opened 5 years ago

dnish commented 5 years ago

I'm trying to implement a persistent store within our application. Currently I'm having a little issue when I subscribe to our main publication. I get 100 DDP "added" messages and also 100 DDP "removed" messages, both showing the same documents. Both occur exactly on the same time. Is this the normal behavior or am I doing something wrong?

jnurkka commented 5 years ago

I had a similar issue and after long debugging figured out that it was caused by the user being authenticated (my publication returned an empty array if the user was not authenticated). A simple solution was to have the publication throw an error instead of returning something if the user was not authenticated