-
Notifications
You must be signed in to change notification settings - Fork 16
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
Issue when using idGeneration: 'MONGO' #12
Comments
Please create a reproduction. I do not get such errors and I cannot really help much without something to work here. One thing to have in mind here is that such errors can occur when there are some other error conditions happening. So because things are asynchronous one side can fail, resolve the future as failure, while something else keeps running and tries to resolve it later again.
It shouldn't be, but maybe it is. Please make a reproduction. |
Ping? |
Sorry for the delay, but I have switched to Reywood:Publish-Composite now, which seems to handle my use case better for me. |
I've the same issue.
Here is my source of publish func: Meteor.publish('test', function () {
this.autorun(function (computation) {
let token = self._token.get(); //get token string
let objID = new Meteor.Collection.ObjectID((token));
return Sessions.find({_id: objID});
})
}); |
Can you create a reproduction? |
test.js Books = new Mongo.Collection('books', {idGeneration: 'MONGO'});
if (Meteor.isClient) {
Meteor.subscribe('books');
Template.test.helpers({
books: function () {
return Books.find();
}
});
Template.test.events({
'click #showComedies': function () {
Meteor.call('showComedies');
},
'click #showHorrors': function () {
Meteor.call('showHorrors');
}
});
}
if (Meteor.isServer) {
let cat = new ReactiveVar('comedy');
Meteor.methods({
showComedies: function () {
cat.set('comedy');
},
showHorrors: function () {
cat.set('horror');
}
});
Meteor.publish('books', function () {
this.autorun(function (computation) {
return Books.find({cat: cat.get()});
});
});
Meteor.startup(function () {
Books.remove({});
Books.insert({title: 'Book 1', cat: 'comedy'});
Books.insert({title: 'Book 2', cat: 'comedy'});
Books.insert({title: 'Book 3', cat: 'horror'});
Books.insert({title: 'Book 4', cat: 'comedy'});
Books.insert({title: 'Book 5', cat: 'horror'});
});
} <head>
<title>test</title>
</head>
<body>
{{> test}}
</body>
<template name="test">
<button id="showComedies">Show comedies</button>
<button id="showHorrors">Show horrors</button>
<ul>{{#each books}}
<li>{{title}}</li>
{{/each}}</ul>
</template> And please click "Show horrors". It seems {idGeneration: 'MONGO'} and default MongoID causes problem. With default Meteor's ids all works fine. |
Sorry, by reproduction I meant a repository I can clone and run. See documentation here. In this way it will really simplify the amount of work I have to do, but I do understand that it requires a bit more work on your side. |
Hm, how often does it happens? I cannot reproduce it. |
Can anyone else reproduce it? |
This is what I saw as well. |
@dpatte: Can you elaborate a bit? Do you see with this repository an error or not when you click the button? Every time? Which operating system are you using? Are you just running |
I opened this ticket, actually, and haven't tried the new repo provided, but while I was using your module I was seeing the same errors from your module as @mzygmunt is now reporting. They occurred whenever a publish occurred. I was running Meteor on Ubuntu 12.04, in a dev environment. |
Yes, my question is about the reproduction. We want to get a clean reproduction and understand why this is happening to you, while it is not happening to others (or me). |
If I have a chance, I'll try the repo, but until then, I may be able to help based on what I remember, if you have any other questions. |
@mitar I updated the repo. Please check it again. https://github.com/mzygmunt/reactive-publish-bug.git |
Perfect. I can reproduce this. |
That's great! When can we expect to solve the problem? |
Not so sure. I am a bit busy these weeks. But it seems that the problem is that there is no good support for this IDs in reactive-publish package. The future issue is just a side effect when error is being thrown. It hides the real error. |
+1 |
While using this module I sometimes get the following error
I am using calls to Meteor.user().find and .findOne in my publish function. Could this be an issue?
The text was updated successfully, but these errors were encountered: