These patches are intended to work around theorized issues with the
Android caching of per-Account user data. They include diagnostic
logging to help understand the state of data on disk, small changes to
the read/write sequence, and a dramatic reduction of getUserData
calls (by maintaining an in-memory cache).
========
dcd54869d1
Author: Nick Alexander <nalexander@mozilla.com>
Bug 964854 - Part 2: Maintain write-through memory cache of Firefox Account bundles.
This should avoid reads from the Android Account user data store, which
we theorize is buggy. It trades those reads for the complexity of
maintaining and invalidating an in-memory cache, which has the potential
to avoid races and cache corruption.
There is no reliable way to determine if an Account has been
removed (and subsequently re-added), so we clear the cache entirely when
any Firefox Account is added. We do this at the authenticator level,
which should be more inclusive than doing it at the AndroidFxAccount
level.
I put the cache itself in AndroidFxAccount, since that is where we have
been storing things associated to the Android Account object; but it
could just as well go in the authenticator.
========
8d65b5dba9
Author: Nick Alexander <nalexander@mozilla.com>
Date: Tue Feb 10 10:42:27 2015 -0800
Bug 964854 - Part 1: Avoid back-to-back setUserData calls.
This is merely a stab in the dark, but if we are in fact seeing caching
errors, perhaps we're tickling them by writing twice when we could write
once.
========
42caec6ee1
Author: Nick Alexander <nalexander@mozilla.com>
Date: Tue Feb 10 10:40:16 2015 -0800
Bug 964854 - Part 0: Change logging.