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

Named anonymous collection can't be returned as part of a cursor array #1820

Closed
mizzao opened this Issue Feb 7, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@mizzao
Contributor

mizzao commented Feb 7, 2014

Demonstrated in https://github.com/mizzao/named-anonymous-collection. I was using a named anonymous collection to collect short-lived data that didn't need to be in the database, and was still published to a named collection on the client.

The following code works:

Other = new Meteor.Collection("other");

if (Meteor.isClient) {
  Coll = new Meteor.Collection("coll");
  Meteor.subscribe("notabug");
}

if (Meteor.isServer) {
  Coll = new Meteor.Collection("coll", {connection: null});

  Meteor.publish("notabug", function () {
    return Coll.find();
  });
}

The following code does not work:

Other = new Meteor.Collection("other");

if (Meteor.isClient) {
  Coll = new Meteor.Collection("coll");
  Meteor.subscribe("thebug");
}

if (Meteor.isServer) {
  Coll = new Meteor.Collection("coll", {connection: null});

  Meteor.publish("thebug", function () {
    return [ Coll.find(), Other.find() ];
  });
}

It throws the error:

W20140207-16:19:28.495(-5)? (STDERR) TypeError: Object [object Object] has no method '_getCollectionName'
W20140207-16:19:28.495(-5)? (STDERR)     at _.extend._runHandler (packages/livedata/livedata_server.js:843)
W20140207-16:19:28.495(-5)? (STDERR)     at _.extend._startSubscription (packages/livedata/livedata_server.js:690)
W20140207-16:19:28.495(-5)? (STDERR)     at _.extend.protocol_handlers.sub (packages/livedata/livedata_server.js:508)
W20140207-16:19:28.495(-5)? (STDERR)     at packages/livedata/livedata_server.js:472
@n1mmy

This comment has been minimized.

Member

n1mmy commented Feb 13, 2014

Good catch. Thanks for the clear reproduction. This is definitely a bug. Will investigate.

@glasser glasser closed this in 181c68b Feb 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment