meteor-flux-helpers icon indicating copy to clipboard operation
meteor-flux-helpers copied to clipboard

Usage in production

Open ryenbeatty opened this issue 10 years ago • 3 comments

I've been deploying an all package app to an ec2 instance, and am noticing that the callback passed to trackCollection does not consistently fire (it will intermittently stop firing for no apparent reason).

As I am looking to ultimately use this package in production, is there anything that can be done to ensure the stability of the core functions? I've also noticed the issue when using the package locally, which is a worry as I need it to work consistently in order to update my views!

Happy to lend a hand if work needs doing to get this production ready, or discuss alternatives to this approach.

Thanks

ryenbeatty avatar Sep 24 '15 03:09 ryenbeatty

Hmm weird. Is there any way to replicate on a test repo? I'm using in production with no probs yet. I also haven't seen this either.

Can you put it in a meteor on ready and then even wrap the watcher in a 0ms set timeout to make sure there isn't a race condition in prod?

AdamBrodzinski avatar Sep 24 '15 12:09 AdamBrodzinski

If that works perhaps I need to add that internally.

Also for tracking the viewer, it might not catch the first event then so removing the ignore first computation (for just the user collection) may help as there's a race condition when it's logging in

AdamBrodzinski avatar Sep 24 '15 12:09 AdamBrodzinski

I'll try and put together a test repo and replicate the issue, may take me a little while as it's quite a complex setup.

I tried wrapping it in both an onready and a 0ms setTimeOut to no avail, what ended up working consistently is putting the collectionChanged action inside the Container component's componentDidMount method, which is a bit hacky but at seems to guarantee the callback.

At the moment I am just using the collectionChanged function.

ryenbeatty avatar Sep 28 '15 00:09 ryenbeatty