So I got this report zimme/meteor-collection-softremovable#26 which was started in meteor/meteor#8220.
It basically uncovered a problem in in my find/findOne before hook logic where I was always initializing selector if it was undefined which was a problem because I made the assumption that when you do collection.find(), selector would be undefined but it turns out that that's not the case. Instead meteor checks for arguments length and if it's 0 then it sets selector to {}.
So I removed this logic and things started working as expected on the server but then I saw that the selector in the hooks on client and server isn't mirroring and it has to do with this line.
It uses different collections on client/server and it seems that somewhere along the line the safe find selector is getting lost in the client collection.
I'm having a hard time tracking this down and thought you might have some thoughts?
So I got this report zimme/meteor-collection-softremovable#26 which was started in meteor/meteor#8220.
It basically uncovered a problem in in my find/findOne before hook logic where I was always initializing
selector
if it wasundefined
which was a problem because I made the assumption that when you docollection.find()
,selector
would beundefined
but it turns out that that's not the case. Instead meteor checks for arguments length and if it's0
then it setsselector
to{}
.So I removed this logic and things started working as expected on the server but then I saw that the
selector
in the hooks on client and server isn't mirroring and it has to do with this line.It uses different collections on client/server and it seems that somewhere along the line the safe find selector is getting lost in the client collection.
I'm having a hard time tracking this down and thought you might have some thoughts?