Closed kwasniew closed 11 months ago
Hi everyone. Since func createFeatureMap(features:)
now stores the [Toggle]
data in storageProvider
instead of returning a result to be stored in Poller.toggles
, I noticed func isEnabled(name:)
in UnleashClientBase
is still accessing data from Poller.toggles
, causing the toggles accessed via isEnabled(name:)
to always return false.
https://github.com/Unleash/unleash-proxy-client-swift/blob/eed05048ad6518239a7098b46cc05dfcca6bce52/Sources/UnleashProxyClientSwift/UnleashProxyClientSwift.swift#L78
@qqKyleShin Thanks for bringing it to our attention. This is fixed now.
@kwasniew thank you!
About the changes
You can inject your own poller that has custom implementation of the StorageProvider protocol. By default we provide in-memory implementation but any user of the SDK can use whatever local storage mechanism they want.
When constructing UnleashProxyClientSwift you need to inject
Poller(refreshInterval: refreshInterval, unleashUrl: url, apiKey: clientKey, session: URLSession.shared, storageProvider: yourStorageProvideImpl)
Important files
Discussion points