meteor-mysql icon indicating copy to clipboard operation
meteor-mysql copied to clipboard

ready() returns false even when subscription is fully loaded

Open andycjw opened this issue 9 years ago • 5 comments

might be related to issue #11 ready() now returns false when subscription is fully loaded, and it's not reactive.

andycjw avatar Apr 13 '15 13:04 andycjw

Can you provide a repo with minimal code to reproduce this that I can clone? I am not seeing this issue with the leaderboard example.

numtel avatar Apr 15 '15 04:04 numtel

this ready() is for the .change() call, or there's no ready() for query change made with .change()

i'll try to make a minimal code base to see if I can reproduce this with certain.

andycjw avatar Apr 15 '15 12:04 andycjw

I tried to created a tinytest for this issue in this commit below, not sure if it's correct, can you take a look at it? It fail the test, but I'm not certain I did the test correctly, andycjw@06f62465bbf901f779dfb525ba920248913de170

andycjw avatar Apr 16 '15 17:04 andycjw

I have added checks of the ready() method to the change() method test: https://github.com/numtel/meteor-mysql/commit/017bdf26258cbd582c55a4e08e88641b2b510f41

Putting tracker.autorun in a test case (with the way my tests are set up in this package anyways) will cause problems because it will not stop when other tests are running.

numtel avatar Apr 16 '15 20:04 numtel

okay, the issue I saw only happen during invalidation of MysqlSubscription caused by .change(), it will give ready() as True when it first invalidated, but .length is not correct. How should we test this? Is there any way to the the reactive ready() is correct, I think setTimeout doesn't catch that

andycjw avatar Apr 17 '15 04:04 andycjw