growthbook / growthbook-sdk-java

The Java SDK for GrowthBook (JVM, Android)
https://docs.growthbook.io/lib/java
MIT License
7 stars 10 forks source link

0.9.0 broke backwards compatibility without adequate release notes #39

Closed Spikhalskiy closed 11 months ago

Spikhalskiy commented 11 months ago
  1. GBFeaturesRepository started to accept a new parameter refreshStrategy. While it's not documented, I guess that to save an old behavior we can pass null there. It would be nice if GBFeaturesRepository had a constructor without this parameter at all to maintain backwards compatibility.
  2. There is a new mandatory backward-incompatible String clientKey in GBFeaturesRepository constructor. clientKey – Your client ID, e.g. sdk-abc123 javadoc is not very helpful in understanding the meaning and importance of the new parameter. It's not immediately clear how to convert an old way of setting up GBFeaturesRepository into the new one.
  3. First parameter of GBFeaturesRepository changed meaning from the full URL to just a host.

Release notes don't have any information on the breaking changes and migration. It would be good to have a step-by-step guide on how to migrate existing working setup to the new API.

Something like:

1. Take the previous full URL you used. The last part of the URL is your clientKey that now needs to be supplied as a `clientKey` param.
2. You can supply null into `apiHost`, `https://cdn.growthbook.io` will be used by default.
3. `encryptionKey` stayed without changes, old keys are still valid.
4. Supply `FeatureRefreshStrategy.STALE_WHILE_REVALIDATE` as `refreshStrategy` to maintain an old behavior.
tinahollygb commented 11 months ago

Thanks for the feedback. The release pointed to the PR which does include the breaking changes, however it definitely makes sense to have these added to the release notes as people may not click into each set of changes, so I've added it there as well.

You can see the documentation on fetching features and refreshing for the latest implementation instructions: https://docs.growthbook.io/lib/java#fetching-cacheing-and-refreshing-features-with-gbfeaturesrepository