robfallows / tunguska-reactive-aggregate

Reworks jcbernack:reactive-aggregate for ES6/ES7 and Promises
MIT License
52 stars 27 forks source link

Meteor does not currently support objects other than ObjectID as ids #3

Closed jerradpatch closed 5 years ago

jerradpatch commented 6 years ago

Having an issue, wondering what I am doing wrong. Maybe its due to using Mongo Ids as the _id?

Code:


    if (Meteor.isServer) {
      let options: any = {idGeneration: 'MONGO', 'defineMutationMethods': true};
      let model = new Mongo.Collection('epColl', options);
      let episodeSelector = [
        {$limit:50} 
      ]; //simplified

      Meteor.publish('subscribeTop20', function () {
        ReactiveAggregate(this, model, episodeSelector);
      });
    }

Exception:

Exception from sub OuNeRe_subscribeTop20 id 6w6yJPEj3Smp5bYhy Error: Meteor does not currently support objects other than ObjectID as ids I20180905-19:50:23.759(-4)? at Object.MongoID.idStringify.id [as idStringify] (packages/mongo-id/id.js:77:11) I20180905-19:50:23.760(-4)? at Subscription.added (packages/ddp-server/livedata_server.js:1254:25) I20180905-19:50:23.760(-4)? at docs.forEach.doc (packages/tunguska:reactive-aggregate/aggregate.js:22:15) I20180905-19:50:23.760(-4)? at Array.forEach () I20180905-19:50:23.760(-4)? at Promise.asyncApply (packages/tunguska:reactive-aggregate/aggregate.js:20:12) I20180905-19:50:23.760(-4)? at /home/jerrad/.meteor/packages/promise/.0.11.1.1q584qp.8ndl++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40 I20180905-19:50:23.760(-4)? => awaited here: I20180905-19:50:23.761(-4)? at Function.Promise.await (/home/jerrad/.meteor/packages/promise/.0.11.1.1q584qp.8ndl++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/promise_server.js:56:12) I20180905-19:50:23.761(-4)? at Object.ReactiveAggregate (packages/tunguska:reactive-aggregate/aggregate.js:56:3) I20180905-19:50:23.761(-4)? at Subscription._handler (collections/OuNeRe.ts:46:9) I20180905-19:50:23.761(-4)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1767:12) I20180905-19:50:23.762(-4)? at DDP._CurrentPublicationInvocation.withValue (packages/ddp-server/livedata_server.js:1043:15) I20180905-19:50:23.762(-4)? at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1189:12) I20180905-19:50:23.762(-4)? at Subscription._runHandler (packages/ddp-server/livedata_server.js:1041:51) I20180905-19:50:23.762(-4)? at Session._startSubscription (packages/ddp-server/livedata_server.js:859:9) I20180905-19:50:23.762(-4)? at Session.sub (packages/ddp-server/livedata_server.js:625:12) I20180905-19:50:23.762(-4)? at packages/ddp-server/livedata_server.js:559:43

robfallows commented 6 years ago

That looks like a bug in the way the ids are tracked for the pub/sub API.

robfallows commented 6 years ago

@jerradpatch: please review #4

Thanks 🙂

robfallows commented 5 years ago

Closing due to lack of feedback to #4.

robfallows commented 5 years ago

Reopening this issue following feedback from @ShaggyKris on #4.