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
{{ message }}
This repository was archived by the owner on May 30, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on May 30, 2024. It is now read-only.
I only get the console.log for SHOW/HIDE FEATURE once, even though I see the polling log flood. I am enabling/disabling the feature flag in the dashboard, nothing happens..
Also, I'm curious why you decided to use polling mode here. We generally recommend streaming instead of polling since it offers many benefits like instant updates of your flag configurations in your app.
Reason I used polling is because the streaming method did not work. I started the file, just like the code mentioned, it registered the first feature variation and then silent. When I toggle the feature the first time, I get the log : receive patch event or something.
When I use the polling feature, I see at least the client is pulling every second, but no updates are registered even though I am toggling continuously..
When you get a chance, could share the code you tried with streaming?
I think the reason polling didn't output updates is because variation is only called once. But I would like to understand why streaming wasn't working for you, so that you can start using that mode.
The streaming code is the same as th polling code, only without stream : false
To clarify, when using polling, I see that the client polls for updates every second, what does that have to do with variations run once? Am I missing something?
Activity
apucacao commentedon Nov 29, 2017
Hi @phun-ky ,
Unless I am mistaken, that code only calls
ldclient.variationonce. Have you tried wrapping the call toldclient.variationinsetTimeout?The default polling interval is 1 second, so changes you make on your dashboard should take at ~1s to show up in your client.
Let me know if that helps.
apucacao commentedon Nov 29, 2017
Also, I'm curious why you decided to use polling mode here. We generally recommend streaming instead of polling since it offers many benefits like instant updates of your flag configurations in your app.
Happy to answer any questions as well :)
phun-ky commentedon Nov 29, 2017
apucacao commentedon Nov 29, 2017
When you get a chance, could share the code you tried with streaming?
I think the reason polling didn't output updates is because
variationis only called once. But I would like to understand why streaming wasn't working for you, so that you can start using that mode.phun-ky commentedon Nov 29, 2017
apucacao commentedon Dec 1, 2017
I mentioned that because in your original comment you said, "I only get the console.log for SHOW/HIDE FEATURE once…".
Were you seeing errors in the logs when using streaming?
phun-ky commentedon Dec 13, 2017
Sorry for the late reply, I've managed to do what I want with this code (this code is to fetch flags and decide server routes on my node backend:
In the first versions of this code,
stream: truewas set, but that stopped working somehow, so I had to swtich tostream:false, and then it worked.Which is weird because this code (that is used in an API route) works with streaming:
apucacao commentedon Jan 24, 2018
Hi @phun-ky ,
I'm sorry for the late response here.
Are you still unable to use streaming in both of your use cases? When you try streaming mode, do you get any errors from the SDK?
Also, as a side note, we've released a newer version of the SDK with a few improvements, one of which is clearer errors.
Merge pull request #74 from launchdarkly/eb/ch16654/variation-index