Hi Team, a customer has asked why dont we add "fea...
# sdk-swift
f
Hi Team, a customer has asked why dont we add "features: Data?" to initialiser with API key, in that case SDK will start with cached data for the Swift SDK? Attached is their usecase for this feature.
The best solution I have seen to accommodate this is implementing a fallback. Are there any other solutions available or in development?
c
Hi @flaky-noon-11399. Please let us check that and I will write to you.
f
Thank you @calm-dog-24239 🙏🏾
🙌 1
c
Here is pull request with that.
f
Brilliant!! Thank you for the speedy turnaround on this 🥳
🙌 1
c
You are welcome. Just need to approve that and after release.
f
Perfect, thank you CC @freezing-postman-69602
🙌 1
f
I've reviewed this PR and it needs to more changes to support
default
/
fallback
features incase of internet connection failures. To add more context, if we just modify the initializer to accept
fallbackFeatures
along with the API connection, we'll need graceful mechanisms to use these
fallbackFeatures
and retry the API calls if backgroundSync is turned on. Nevertheless, we'll need to do the following every time we use
features
to evaluate, first, try regular cache (previously fetched from API) and in case of cache-miss or invalidated scenario, we use these fallback features for evaluation. We'll need to log these events carefully, otherwise debugging any unexpected behaviors/results will become a nightmare. Hope this helps. Happy to discuss more if you have any questions.
c
Hi @freezing-postman-69602. Thank you for your feedback. We will follow that and update the PR.