Closed croemmich closed 6 months ago
Hi @croemmich, thank you for reporting this issue! I'm going to create a fix here, because it's indeed a bug in the Kotlin SDK and let you know when it's published. Also, we'll discuss the possibility of removing the whole preferences section of the config JSON on the Proxy side to prevent any accidental redirection.
Thanks @z4kn4fein!
Hi @croemmich, I've released the fix in 3.0.1
(it may take a little longer to be available on maven central).
Regarding the FORCE_REDIRECT
value of the redirect
parameter, I can confirm that it's not used currently anywhere in our system, and we don't plan to do so either. However, we'll definitely figure out something for making the Proxy usage an exception for any possible force redirection.
Our team pulled it in and confirmed it's working. Thanks @z4kn4fein!
Describe the bug
We're running the ConfigCat Proxy (v0.4.2) and have set a custom
baseUrl
. The initial config fetch works however subsequent fetches do not.The issue lies in how preferences from the response are being handled:
https://github.com/configcat/kotlin-sdk/blob/ea7a1fb32f39ac0664b16daf157d99f15823b696/src/commonMain/kotlin/com/configcat/fetch/ConfigFetcher.kt#L33-L39
response.entry.config.preferences?.baseUrl
ishttps://cdn-global.configcat.com
. As such,baseUrl.update { "https://cdn-global.configcat.com" }
is being called, which breaks the client.I'm not sure if this should be fixed in the client or if the proxy should be re-writing the baseUrl.
I also don't love that the
redirect
preference can force thebaseUrl
to update when using the proxy.SDK version
com.configcat:configcat-kotlin-client-jvm:3.0.0
SDK configuration
Logs
Language/Framework version
Kotlin 1.9.23 Java 21
Platform
Mac/Linux