One more question. We were previously using vers...
# sdk-flutter
b
One more question. We were previously using version 3.9.9, but recently updated to the latest SDK to take advantage of remote evaluation. Just to confirm our understanding: Before (in 3.9.10 and earlier), calling sdk.feature('test-flag').on didn’t trigger a request to fetch feature flags from the server — it only relied on locally cached or preloaded data, correct? But from what we see, that behavior changed in version 3.9.11 (commit link); now the SDK uses caching (with a default TTL of 60 seconds), and if the cache is expired, it fetches fresh data from the server. Is that correct?
c
Hi @busy-window-96391. Yes, that's correct. Previously, in versions up to 3.9.10, calling
sdk.feature("test-flag").on
did not trigger a request to the server — it relied solely on locally cached or preloaded data. Now, the SDK follows a stale-while-revalidate approach. This means that if the TTL has expired, the first call to
feature.on
will return the stale value, but it will also trigger a background fetch. The next call will then return the updated result. This method is indeed the correct and intended behavior. However, we noticed that some changes introduced after the initial release of this feature unintentionally broke the TTL logic. At the moment, the
ttlSeconds
value is not passed correctly and always defaults to
60s
. Additionally, other methods (such as
isOn
) are not working as expected. That’s why we created a PR that fixes this logic. Once that PR is released, everything will work exactly as you described.
🙌 1