Closed valeriyo closed 1 year ago
Hi @valeriyo, thank you for reporting!
I'm planning to apply our ongoing SDK improvements (e.g., for swift here) to this SDK next. It'll include the success indication of forceRefresh()
that you reported on the Android SDK, and I'll also include the fix for this issue.
About the issue: I'm not sure why the write()
should take String?
; the SDK won't call write()
if it does not have a valid value to save. What do you think?
Hi @valeriyo, we released a new version of the Kotlin SDK (v1.0.2
) with fixes to the related issues. Feel free to let us know if you have more suggestions.
@z4kn4fein the ConfigCache.read
returns String?
(which is correct) but the write(key: String, value: String)
doesn't allow null value, is that intentional? I think it's a mistake - empty string should be a valid value, and there should be a way to clear out the cached value with a null
. Thanks!
Hi @valeriyo, the SDK won't call write()
when it doesn't have a valid value to cache. There's no such case as the SDK clearing the cache, it only writes the latest valid (non-empty and non-null) configuration into it.
Oh ok - so once a value is written, it will stay there forever (as long as the app is installed).. I guess that's expected?
Yep, it'll stay there and will be reused. The SDK determines the cache key from the SDK keys you use, so it'll use a single cache entry per SDK key. It'll overwrite the same entry when a config for an SDK key is updated.
This issue is marked stale because it has no activity in the last 3 weeks. The issue will be closed in one week. Please remove the stale flag to keep it open.
This issue was closed due to no activity.
I migrated from
configcat-android-client
and it was quite strange thatinterface ConfigCache
uses empty strings instead ofnull
to indicate "no value". Please change it:read
to returnString?
andwrite
to takevalue: String?
This would be a breaking change, but I think it's worth getting it right.