-
Notifications
You must be signed in to change notification settings - Fork 80
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
Use real subscription context #160
Conversation
Because I use official code to publish, not accounts-base returning |
So this seems to work for me. I made it so that the publish context is really the official one. Also much of the official code is reused. I also fixed some small bugs which I discovered (for example, passing values as reference instead of copying it, and not removing fields in I would guess we could go even further and even make our "session" object the official one, and make it so that it keeps internal state of documents and all merging across subscriptions could be reused, we only make it so that when session sends a message, it does not really send a message to the client, but to our copy of client data on the server. So we override the session's |
cbff95d
to
6b28718
Compare
I think this is great. Merge box related stuff goes to a different PR I guess after this. There are many apps (and yes accounts package) returns null thinking it'll stop the publication. We need to handle it with by overriding On there, we need to convert |
But how does Meteor handle this? How does it know that client-side does not have to wait for |
BTW, |
@mitar Okay got it. (yeah, the code looks fresh to me). In the accounts case, it's a universal publication and it has no meaning of This is a pretty big issue if done in the FR related code. (Since this leads to 500ms delay in the server). |
OK, I will address this by wrapping the handler itself. |
And then, you may need to wrap, |
cursor.rewind(); | ||
var collectionName = | ||
(cursor._cursorDescription)? cursor._cursorDescription.collectionName: null || //for meteor-collections | ||
(cursor._collection)? cursor._collection._name: null; //for smart-collections |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, this is also something which was removed in the process. I do not know if this is problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. I assume there's no app use smart-collections
these days :D
I looked into this a bit more. In fact, universal subscriptions do not even have ready and stopped state. So this is in fact a completely arbitrary choice for us when we decide it is "ready". I would propose that instead of checking for |
@mitar Okay. That's a good idea. |
Fixed. |
//stop any runaway subscription | ||
//this can happen if a publish handler never calls ready or stop, for example | ||
//it does not hurt to call it multiple times | ||
publishContext.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added this now.
Awesome. |
Merged and released as |
Pull request for #159.