We've keep tripping over this expiration in different places so it's time to fix it. Some examples have been:
The solution (already been discussed with @bnjbvr a week or two ago) would be to remove TtlStoreValue and it's STALE_THRESHOLD and always return the cached value. Alongside this, we would need a mechanism that would make the relevant API calls in the background, caching any valid responses so that the next read is up to date. These background refreshes should ideally wait until any sync loops are running and up-to-date to avoid slowing down initial syncs and at the very least should be scheduled every time a Client is created (although ideally using something like SyncService::start to schedule the refreshes would help long-lived Clients to stay more up to date as apps get backgrounded and foregrounded).
We've keep tripping over this expiration in different places so it's time to fix it. Some examples have been:
/versionsrequest in theRoomListServicebuilder #5853 feat(sdk): Support refreshing the access token in Client::fetch_server_versions #5916rtc_focitaking up to 7 days to be picked up by clients (admittedly we should be using the newer CS API endpoint for this now, but that would still involve caching a value) which became even more apparent after fix(sdk): Use the server name from the user id as a fallback URL for fetching the well-known info #5996 which had no immediate effect unless the cache was cleared.SyncServiceBuilder::buildcan fail with network related errors such as DNS resolution/Timeouts/Temporary server errors when checking server support for thread subscriptions. If we want good offline support in the SDK (and to handle poor connections gracefully) aClientand its associated services should really not be making network requests to be built and supply already cached data.The solution (already been discussed with @bnjbvr a week or two ago) would be to remove
TtlStoreValueand it'sSTALE_THRESHOLDand always return the cached value. Alongside this, we would need a mechanism that would make the relevant API calls in the background, caching any valid responses so that the next read is up to date. These background refreshes should ideally wait until any sync loops are running and up-to-date to avoid slowing down initial syncs and at the very least should be scheduled every time aClientis created (although ideally using something like SyncService::start to schedule the refreshes would help long-livedClients to stay more up to date as apps get backgrounded and foregrounded).