Comments (9)
I think a new issue would be better instead of commenting on and old one.
But this is a great catch! No, this was not expected. I have copied this from the client side code, which does not have this restriction. Maybe open an issue in reactive-mongo package and we can work through it there?
from meteor-reactive-publish.
This sounds like something connected with polling instead of oplog? Polling is every 10 seconds? Do you have oplog enabled on production?
Can you share some code?
Also, rerunning on userId change is something done already. Do you need to use autorun?
from meteor-reactive-publish.
I suspected polling but i have been told that my deployed system is actually using oplog.
Changing userId changes the list of users whose data I want to publish. I actually then publish more detailed data about each user, as well as their docs.
from meteor-reactive-publish.
Can you show some code?
from meteor-reactive-publish.
It turns out that the deployed system is using polling after all. So, yes it has to do with polling.
I have also discovered that it also only occurs on pages that have Router.onBeforeAction(requireLoginRt, .....
I'm now beginning to think it is a router issue, or a conflict between iron router and reactive publish, or related to polling's lazy comparison of record changes.
from meteor-reactive-publish.
Can you create a small reproduction?
from meteor-reactive-publish.
Actually, I removed the autorun, and I still have the issue. I guess the problem is somewhere else. Thanks for putting up with my questions.
from meteor-reactive-publish.
@mitar I'm a bit confused here - it seems like any find
done within an autorun (excluding the cursor which is returned) uses the polling observe driver.
For example, if I have:
Meteor.publish('messagesForGroup', function (groupId) {
this.autorun(() => {
const group = Groups.findOne(groupId, { fields: { members: 1 } });
if (group.members.indexOf(this.userId) > -1) {
return Messages.find({ group: group._id });
}
});
});
It seems like the findOne Groups.findOne(groupId, { fields: { members: 1 } });
uses polling instead of oplog.
Is that expected?
from meteor-reactive-publish.
From what I can tell, the reactive-mongo package adds addedBefore
and movedBefore
callbacks to fetch
, map
and forEach
on cursors.
Because of this, it fails the first check in observeChanges
in Meteor's mongo_driver.js for whether or not it can use oplog.
The presence of addedBefore
and movedBefore
means that ordered
returns true when the driver calls LocalCollection._observeChangesCallbacksAreOrdered.
Was it ever intended for finds inside of server-side autoruns to use oplog or are they always expected to fall back on polling?
from meteor-reactive-publish.
Related Issues (20)
- Probably we should not be doing handles.push(result) if handles is a computation
- After updating to Meteor 1.4.4.1 ReactiveVar is not defined HOT 14
- Multiple cursors for collection HOT 6
- Make sure DDP._CurrentPublicationInvocation is correctly set during autorun reruns HOT 1
- Update to latest server-autorun dependency HOT 3
- Error on Meteor Update 1.6.1 when using practicalmeteor:mocha HOT 48
- Re-using observers HOT 8
- it doesn't work with meteor 1.6.1 ? HOT 6
- Is reactive-publish expected to work with this.changed on a "virtual" collection? HOT 14
- Stopping subscription before it's ready can leave observers running forever HOT 2
- Question: How to publish to specific client side collection? HOT 2
- [Meteor 1.8.1] data not removed from client due to ddp-server internal changes HOT 12
- Question: Meteor 1.8.1 - ReferenceError: ReactiveVar is not defined HOT 4
- Update peerlibrary:reactive-mongo dependency to @0.3.0 HOT 3
- Nested autoruns on server is sending ready message before all autoruns are ready HOT 4
- Memory leak server crash with (0.3.0) HOT 2
- Issue with using observeChanges in autorun function HOT 4
- Update observing query changes patching
- The package overrides or ignores my Mongo poolSize setting HOT 1
- ReferenceError: ReactiveVar is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-reactive-publish.