launchdarkly / android-client-sdk

LaunchDarkly Client-side SDK for Android
Other
45 stars 23 forks source link

JSON flag requested as String log doesn't include flag #116

Closed gpeal closed 3 years ago

gpeal commented 3 years ago

Is your feature request related to a problem? Please describe. We have many feature flags in a large codebase and are getting generic logs like:

JSON flag requested as String. For backwards compatibility returning a serialized representation of flag value. This behavior will be removed in the next major version (3.0.0)

These are impossible to track down. I just did a manual audit of hundreds of flags to see if we're using any JSON flags as String and didn't find any manually.

Describe the solution you'd like Include the relevant flag in any logs like this.

Describe alternatives you've considered Manually check hundreds of flags.

We would love to see https://github.com/launchdarkly/android-client-sdk/issues/113 as well

gwhelanLD commented 3 years ago

Hi @gpeal,

Thanks for the suggestion! I can see why that message is less than optimal. I've filed this internally so we can address it.

Thanks, @gwhelanLD

gpeal commented 3 years ago

@gwhelanLD On that note, I don't really see it as a problem to access a json flag as a string either. It's useful to use the json variation input fields on web but on the Android side, it's better to pass a raw string to whatever json parsing library you use (we use Moshi) and let it do the parsing into your own model. Forcing you to retrieve it as a JsonElement isn't actually very useful in most cases.

gwhelanLD commented 3 years ago

Hi @gpeal,

This improvement has been included in the new 2.14.2 patch release. Unfortunately this didn't get out before the 3.0.0 release, but if you're still on 2.x upgrading to 2.14.2 will help to track down any JSON flags being requested as Strings before upgrading to 3.0.

Thanks, @gwhelanLD