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:
suspend fun updateContext(context: HashMap<String, Any>) {
visitor.updateContext(context)
visitor.fetchFlags().await()
}
updateContext(hashMapOf("foo" to "foo"))
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:
|
override fun fetchFlags(): Deferred<Unit> { |
Would it be possible to optimize fetchFlags() to only update flags when necessary, or add restrictions to avoid sending too many API requests?
Thanks.
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:flagship-android/flagship/src/main/java/com/abtasty/flagship/visitor/DefaultStrategy.kt
Line 69 in 1092282
Would it be possible to optimize
fetchFlags()to only update flags when necessary, or add restrictions to avoid sending too many API requests?Thanks.