-
Notifications
You must be signed in to change notification settings - Fork 0
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
onReady() listener doesn't work when fresh installing the app having pooling disabled. #88
Comments
@jnavarro98 I'm trying to understand this. If you're never polling the SDK will never be ready unless you provide a bootstrap, in which case the SDK will be ready as soon as the bootstrap file is read. If you want to have polling disabled you need to explicitly tell unleash to do at least one fetch of the features configuration. If the SDK has not seen any configuration (either from polling or from a bootstrap) it won't be ready. You can see many of our tests cover this use case, this is just an example: unleash-android/unleashandroidsdk/src/test/java/io/getunleash/android/DefaultUnleashTest.kt Lines 146 to 174 in 5e0519a
To manually trigger 1 fetch an never poll again you have the following methods: unleash-android/unleashandroidsdk/src/main/java/io/getunleash/android/Unleash.kt Lines 32 to 42 in 730bc21
Let me know if I misunderstood your request, but initially it doesn't seem like a bug. |
We've added #90 that is a very specific test for this particular use case |
Thanks for the clarification. I found that the documentation in your website is quite lacking. When I call unleash.start I expect it to at least fetch flags, I shouldn't have to do reverse engineering to understand the behaviour of an sdk. There were many times where I had to figure out many things by looking at your code. For example the Heartbeat listener, needing to have the unleash.start in the main thread (or else it crashes) and many other features your SDK provide aren't documented. This is not acceptable for an SDK. Please work on the documentation. |
Our assumption is that when you set the polling strategy to disabled, you don't want to poll (therefore you don't fetch flags), but maybe you understand it differently. I could see another way of understanding "polling disabled" is "continuous polling is disabled, but at least the SDK will fetch once". On the other hand, we have users that don't want that initial fetch because they want to control when that happens so we need to account for both.
This SDK is quite new, and as that the documentation is also quite fresh. We tried to support many different use cases (fetch, don't fetch, fetch once, fetch when the customer wants, etc), so that creates quite a lot of different combinations to cover. The ones that are documented in the website are the basics, but we will continue to improve them based on feedback or external contributions. If you have a snippet of what failed in your setup or how you ended up configuring your SDK for your use case we can add that, or if you have a suggestion how to make the polling configuration clearer we can also look into that. |
Thanks for the snippets! I'll try to do that next week and share a PR here.
Software is an iterative process and we'll get there eventually, but it's a moving target. Every piece of help we get from the community such as what you did, helps us make the product better. Thank you! |
Describe the bug
Initializing unleash with
.pollingStrategy.enabled(false)
when fresh installing the app doesn't triggeronReady()
listener.However if the app was installed and had pooling enabled, then changed to pooling disabled,
onReady()
is called correctly.It seems that in order to have the listeners working, you have to have pooling enabled at least once.
This makes
.pollingStrategy.enabled(false)
useless for our use case (we block the app launch relying in this listener).Our workaround was to have pooling enabled with
.pollingStrategy.interval(Long.MAX_VALUE)
Steps to reproduce the bug
Have unleash initialized with
.pollingStrategy.enabled(false)
Expected behavior
onReady()
is called when sdk is initializedUnleash version
1.0.1
Subscription type
Enterprise
Hosting type
Self-hosted
The text was updated successfully, but these errors were encountered: