Getting an arguments check() error when no arguments are being passed


#1

I want to improve the security of my app by adding the audit arguments checks package. However, I now get a server error (see below) for the following.


    Meteor.publish('votes', function() {
      return Votes.find(); 
    });

Since I am not (explicitly) passing any arguments to the function, how can I add the necessary checks? (Ie what should I be checking for in a case like this?)

This is the error I get:


    I20151027-17:40:27.689(-4)? Exception from sub votes id nJE7yowWaP9v5CA8F Error: Did not check() all arguments during publisher 'votes'
    I20151027-17:40:27.690(-4)?     at [object Object]._.extend.throwUnlessAllArgumentsHaveBeenChecked (packages/check/match.js:411:1)
    I20151027-17:40:27.690(-4)?     at Object.Match._failIfArgumentsAreNotAllChecked (packages/check/match.js:106:1)
    I20151027-17:40:27.690(-4)?     at maybeAuditArgumentChecks (livedata_server.js:1695:18)
    I20151027-17:40:27.690(-4)?     at [object Object]._.extend._runHandler (livedata_server.js:1023:17)
    I20151027-17:40:27.691(-4)?     at [object Object]._.extend._startSubscription (livedata_server.js:842:9)
    I20151027-17:40:27.691(-4)?     at [object Object]._.extend.protocol_handlers.sub (livedata_server.js:614:12)
    I20151027-17:40:27.691(-4)?     at livedata_server.js:548:43

Thanks for any tips or advice!


#2

Are you sure you have not forgotten an argument you are passing from the subscribe() call?


#3

This is all I have on the subscribe side, so no arg being passed there:

Meteor.subscribe('votes');

#5

What about using ES2015 optional/rest function params? That’s a better way to go rather than arguments.


#6

Thanks for the tip. Will check it out.


#7

Are you most definitely sure that’s the only subscription to the votes publication and that there is not another lurking around in your codebase, one that passes an argument?


#8

May I what was the solution? Facing the same issue. Thanks.