Although it seems very easy to implement, DDP Rate Limiting for Meteor Subscriptions seems to be not working.
I have the following code snippet in “/imports/api/server” folder.
Meteor.publish('todos.public', function todosPublic () {
return Todos.find(
{ },
{ fields: Todos.fieldsExposed }
);
});
I provide a rate limiter in “/imports/startup/server” folder as follows;
const todosPublication = {
type: 'subscription',
name: 'todos.public',
};
DDPRateLimiter.addRule(todosPublication, 1, 100);
And I test the limiter in a React component in the following code;
componentWillMount () {
for (let i = 0; i < 25000; i++) {
console.log('i');
Meteor.subscribe('todos.public');
}
}
The result is I don’t get any error, which means the limiter does not work.
Moreover, I don’t see any rate limiting for Subscriptions in Meteor React Tutorial code, either. But, they have for Methods.
Any idea?