This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
WorkManagerSyncWorker
requests a new OAuth token every sync
#3357
Labels
<sync>
Component: sync-logins
From slack discussion with @grigoryk.
The
WorkManagerSyncWorker
class deserializes a freshFirefoxAccount
object out of preferences for every sync, as seen here.This works fine from a functional perspective, but it defeats some important internal caching done by the
FirefoxAccount
object. The result is that every time Fenix syncs, it has to:access_token
from the Firefox Accounts servers.The tokens from steps (1) and (2) live for several hours and should be cached to amortize the server load cost across multiple syncs. The app-services
FirefoxAccount
object caches the token from (1) for this purpose, but only in an in-memory cache on the object. Ideally theWorkManagerSyncWorker
would be able to use the app's existingFirefoxAccount
instance rather than creating a fresh one for each sync. (It may be that that's not feasible, and we have to think of some other approach, but I think it's the best place to start).I'm concerned about the server load impact on FxA if the Fenix userbase grows too large with the current behaviour of fetching a fresh token on every sync.
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: