You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, first thanks for this optimisation item without which I cannot imagine my applications to be. I have found a possible bug in the implementation, when subscription manager is interfering with "ReactMeteorData" mixin. I am attaching a minimal repro application.
The problem is, that if you use a component with subscriptions inside another component with subscriptions, it is invalidating the parent subscriptions, making them run twice or more. Example:
I have following components and only parent has subscriptions:
<Parent>
<Child>
</Parent>
If I put following line inside paren's "render" method console.log("With: " + this.data.posts) where data is fed with following method:
Now I add another subscription inside child component as following:
getMeteorData(){this.data={}varhandle=subs.subscribe("user",this.props.post.uid);// Replace with Meteor.subscribe and all is goodif(handle.ready()){this.data={user: Usrs.findOne({uid: this.props.post.uid})}}returnthis.data;}
Somewhere there, the subscription invalidated meteor data and it ran again creating havoc in the application. Please note, that when I replace subs.subscribe with Meteor.subscribe all is running as expected and data is not invalidated.
Thanks! Just a question regarding performance .. .will that affect subsmanager performance if I will be creating a new instance of subs manager per each subscription? Will that interfere with its functionality ?
Thanks.
On Fri, Sep 18, 2015 at 7:25 AM Tomas Trescak [email protected]
wrote:
Thanks! Just a question regarding performance .. .will that affect
subsmanager performance if I will be creating a new instance of subs
manager per each subscription? Will that interfere with its functionality ?
Thanks.
—
Reply to this email directly or view it on GitHub #55 (comment)
.
Hi, first thanks for this optimisation item without which I cannot imagine my applications to be. I have found a possible bug in the implementation, when subscription manager is interfering with "ReactMeteorData" mixin. I am attaching a minimal repro application.
The problem is, that if you use a component with subscriptions inside another component with subscriptions, it is invalidating the parent subscriptions, making them run twice or more. Example:
I have following components and only parent has subscriptions:
<Parent>
<Child>
</Parent>
If I put following line inside paren's "render" method
console.log("With: " + this.data.posts)
where data is fed with following method:The output is following as expected:
Now I add another subscription inside child component as following:
Output becomes:
Somewhere there, the subscription invalidated meteor data and it ran again creating havoc in the application. Please note, that when I replace
subs.subscribe
withMeteor.subscribe
all is running as expected and data is not invalidated.Example minimal app is here 6Kb.
The text was updated successfully, but these errors were encountered: