Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive publishing fails with recent changes #61

Closed
ramezrafla opened this issue Nov 28, 2016 · 3 comments
Closed

Reactive publishing fails with recent changes #61

ramezrafla opened this issue Nov 28, 2016 · 3 comments
Labels

Comments

@ramezrafla
Copy link
Contributor

ramezrafla commented Nov 28, 2016

The last functioning commit is this one:

commit 84fe684c98b1b101eed3cb66ee3eb5dc11b2ba0d
Merge: f24f549 4762210
Author: Theodor Diaconu <diaconu.theodor@gmail.com>
Date:   Mon Nov 28 09:38:59 2016 +0200

    Merge pull request #56 from ramezrafla/patch-2
    
    Remove lack of support for callbacks in readme

We use package peerlibrary:reactive-publish like this:

    Meteor.publish('applications', function() {
      if (!this.userId) return;
      this.autorun(function() {
        var user = Meteor.users.findOne(this.userId,{fields:{'profile.applications.available':1}});
        var ids = user.profile.applications && user.profile.applications.available ? user.profile.applications.available : null;
        if (ids) return self.collection.find({_id:{$in:ids}},{fields:{name:1}});
        return self.collection.find({'default':true},{fields:{name:1}});
      })
    });

Here is the error

I20161128-12:08:13.285(-5)? Exception from sub applications id yofkZPqi4YCuWgLAH RangeError: Maximum call stack size exceeded
I20161128-12:08:13.286(-5)?     at Array.some (native)
I20161128-12:08:13.286(-5)?     at _.some._.any (packages/underscore.js:267:59)
I20161128-12:08:13.287(-5)?     at Function._.find._.detect (packages/underscore.js:217:5)
I20161128-12:08:13.287(-5)?     at Function.Mongo.Collection.get (packages/dburles_mongo-collection-instances.js:32:22)
I20161128-12:08:13.289(-5)?     at new ObservableCollection (packages/cultofcoders:redis-oplog/lib/cache/ObservableCollection.js:25:48)
I20161128-12:08:13.290(-5)?     at packages/cultofcoders:redis-oplog/lib/cache/PublicationEntry.js:20:20
I20161128-12:08:13.291(-5)?     at Array.map (native)
I20161128-12:08:13.291(-5)?     at new PublicationEntry (packages/cultofcoders:redis-oplog/lib/cache/PublicationEntry.js:19:46)
I20161128-12:08:13.291(-5)?     at create (packages/cultofcoders:redis-oplog/lib/mongo/extendObserveChanges.js:15:20)
I20161128-12:08:13.292(-5)?     at Cursor.module.export.exports.default.cursor.observeChanges (packages/cultofcoders:redis-oplog/lib/mongo/extendObserveChanges.js:28:16)
I20161128-12:08:13.292(-5)?     at Cursor.MeteorCursor._depend (packages/peerlibrary_reactive-mongo.js:73:8)
I20161128-12:08:13.292(-5)?     at Cursor.MeteorCursor.(anonymous function) [as fetch] (packages/peerlibrary_reactive-mongo.js:98:12)
I20161128-12:08:13.293(-5)?     at ObservableCollection.init (packages/cultofcoders:redis-oplog/lib/cache/ObservableCollection.js:83:32)
I20161128-12:08:13.293(-5)?     at packages/cultofcoders:redis-oplog/lib/cache/PublicationEntry.js:95:34
I20161128-12:08:13.294(-5)?     at Array.forEach (native)
I20161128-12:08:13.294(-5)?     at PublicationEntry._performInitialAddForObserver (packages/cultofcoders:redis-oplog/lib/cache/PublicationEntry

And we get many of these (but could be unrelated to the above publishing, we have many reactive publishing in our app which could trigger this, just mentioning for completeness)

I20161128-12:11:04.816(-5)? Exception in queued task: TypeError: Cannot read property '_id' of undefined
I20161128-12:11:04.816(-5)?     at packages/cultofcoders:redis-oplog/lib/utils/deepExtend.js:11:13
I20161128-12:11:04.817(-5)?     at Function._.each._.forEach (packages/underscore.js:147:22)
I20161128-12:11:04.817(-5)?     at deepExtend (packages/cultofcoders:redis-oplog/lib/utils/deepExtend.js:10:7)
I20161128-12:11:04.817(-5)?     at ObservableCollection.change (packages/cultofcoders:redis-oplog/lib/cache/ObservableCollection.js:147:9)
I20161128-12:11:04.817(-5)?     at handleUpdate (packages/cultofcoders:redis-oplog/lib/processors/direct.js:26:26)
I20161128-12:11:04.817(-5)?     at module.export.exports.default (packages/cultofcoders:redis-oplog/lib/processors/direct.js:11:13)
I20161128-12:11:04.817(-5)?     at Object.task (packages/cultofcoders:redis-oplog/lib/redis/RedisSubscriber.js:59:28)
I20161128-12:11:04.817(-5)?     at [object Object]._.extend._run (packages/meteor.js:807:18)
I20161128-12:11:04.817(-5)?     at packages/meteor.js:785:14
@theodorDiaconu
Copy link
Contributor

@ramezrafla that commit actually fixed the publishComposition for publish-composite, but it seemed it broke for: peerlibrary:reactive-publish, got it, will fix.

@ramezrafla
Copy link
Contributor Author

Thanks! I wanted to make sure I was clear in my message above, the commit mentioned DOES work, the ones after do not! I am available to test when you give me the signal. Thanks a lot!

@theodorDiaconu
Copy link
Contributor

@ramezrafla
Exception in queued task: TypeError: Cannot read property '_id' of undefined

This is very weird, basically you have a subscription active based on _ids, and you do an update to an _id, and it can't find it in the observable collection for some unknown reason.. They are separate issues I believe. Can you give me more details on the 2nd one ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants