Hello.
We have noticed an intriguing behavior when updating the Flagship context.
Let's suppose we have this context: {"foo": "foo", "bar": "bar"}
And we update the context like so:
suspend fun updateContext(context: HashMap<String, Any>) {
visitor.updateContext(context)
visitor.fetchFlags().await()
}
updateContext(hashMapOf("foo" to "foo"))
Flagship Version: 3.1.0 Bucketing mode
Hello. We have noticed an intriguing behavior when updating the Flagship context. Let's suppose we have this context:
{"foo": "foo", "bar": "bar"}
And we update the context like so:Then we can see in the logs that
fetchFlags()
sends an API request to https://decision.flagship.io/v2/xxxxx/events, even though the context hasn't changed.It doesn't look like
fetchFlags()
checks for context modification (visitor.flagFetchingStatus
) before sending the API request, so it sends requests that are not necessary: https://github.com/flagship-io/flagship-android/blob/10922824e4d44c5d50d47edc63b22a1729d1fd44/flagship/src/main/java/com/abtasty/flagship/visitor/DefaultStrategy.kt#L69Would it be possible to optimize
fetchFlags()
to only update flags when necessary, or add restrictions to avoid sending too many API requests? Thanks.