nate-strauser / meteor-publish-performant-counts

Meteor package to help you publish a near real time count of large collections

Home Page:https://atmospherejs.com/natestrauser/publish-performant-counts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RangeError

marvin-bitterlich opened this issue · comments

I20170113-11:44:26.613(1)? Exception from sub numberOfJobs id xsxvwZCifT67F4Ni7 RangeError: Maximum call stack size exceeded
I20170113-11:44:26.613(1)?     at Object.EJSON.clone (packages\ejson.js:519:7)
I20170113-11:44:26.614(1)?     at packages\ejson.js:521:22
I20170113-11:44:26.614(1)?     at Function._.each._.forEach (packages\underscore.js:147:22)
I20170113-11:44:26.615(1)?     at Object.EJSON.clone (packages\ejson.js:520:5)
I20170113-11:44:26.615(1)?     at packages\ejson.js:521:22
I20170113-11:44:26.615(1)?     at Function._.each._.forEach (packages\underscore.js:147:22)
I20170113-11:44:26.615(1)?     at Object.EJSON.clone (packages\ejson.js:520:5)
I20170113-11:44:26.615(1)?     at packages\ejson.js:521:22
I20170113-11:44:26.616(1)?     at Function._.each._.forEach (packages\underscore.js:147:22)
I20170113-11:44:26.616(1)?     at Object.EJSON.clone (packages\ejson.js:520:5)

This pops up on the server when I try to subscribe to this collection:

Meteor.publish('numberOfJobs', function (filter: string) {
    let query: any = parseQuery(filter, this.userId);
    return new Counter('numberOfJobs', Jobs.find(query));
});

My parsequery is just some sanitizing of the query. I got the same error when I just do a find without any query. (And I use the same parseQuery function for my normal publish and it works fine there)

+1

Exception from sub ordersWithOptionsCnt id wDR6SphAP8BsQDs5A { stack: 'RangeError: Maximum call stack size exceeded\n at Object.EJSON.clone (packages/ejson.js:519:7)\n at packages/ejson.js:521:22\n at Function..each..forEach (packages/underscore.js:147:22)\n at Object.EJSON.clone (packages/ejson.js:520:5)\n at packages/ejson.js:521:22\n at Function..each..forEach (packages/underscore.js:147:22)\n at Object.EJSON.clone (packages/ejson.js:520:5)\n at packages/ejson.js:521:22\n at Function..each..forEach (packages/underscore.js:147:22)\n at Object.EJSON.clone (packages/ejson.js:520:5)',