Skip to content
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

observables are never stopped #4

Open
rubenlagatie opened this issue Feb 24, 2015 · 4 comments
Open

observables are never stopped #4

rubenlagatie opened this issue Feb 24, 2015 · 4 comments

Comments

@rubenlagatie
Copy link

Hi Maksim

I'm using your meteor data proxy, but it seems the query handle created by cursor.observe is not stopped when you call load on the same object again (e.g. to load other data in the component).
From the meteor docs:
"observe returns a live query handle, which is an object with a stop method. Call stop with no arguments to stop calling the callback functions and tear down the query. The query will run forever until you call this."
As a result, when the original data changes, the observable still tries to update the view, but its data has changed, resulting in an error.

I believe this could be resolved by storing the returned object from this.cusor.observe in this.query and before creating a new query calling this.query.stop() if this.query is already set.

I'm not sure destroying the webix object cleans this up either, it might result in memory problems.

@rubenlagatie
Copy link
Author

Storing it in the proxy is not enough, because a new proxy is created every time. Storing it in the view itself does the trick.

mkozhukh added a commit that referenced this issue Feb 25, 2015
@mkozhukh
Copy link
Member

Yep, I see the issue
It will be fixed in oncoming Webix 2.3. View object will destroy the proxy when it is reloaded with new data or when view itself is destroyed.

@mkozhukh
Copy link
Member

Also, if you need to load data only, without full sync then you can use autorun instead of a proxy. It will stop observing after template destroying automatically.

dandv/meteor-webix#5 (comment)

@dandv
Copy link
Contributor

dandv commented Apr 27, 2015

It will be fixed in oncoming Webix 2.3

@mkozhukh, any updates now that Webix 2.3.8 is out? Also, this line mentions a Webix 2.2 limitation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants