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.
I have tested and see no issues with hiding the checkbox when the
service is build-time disabled.
========
d2890e5747
Author: Nick Alexander <nalexander@mozilla.com>
Date: Mon Feb 9 15:47:59 2015 -0800
Bug 1123116 - Include Reading List checkbox in status activity.
We're careful to only show the checkbox when the service is compiled in.
This is a reasonable-sized refactoring underneath a small feature-patch.
The refactor reworks what information we maintain (and pickle) about
"enabled" services. We've moved from a boolean "Sync enabled" flag to a
map of Android authorities (which map to services like Firefox Sync and
reading list) and boolean flags indicating whether each authority is
"automatically synced". The checkboxes in the status activity
correspond directly to whether the authority (service) is automatically
synced.
The set of authorities we care about is determined by the DEFAULT_* map.
Said map is interrogated and written to the pickle file at Sync time.
When the pickle file is un-pickled, only the set of known authorities is
acted upon. What that means is that both writing and reading a pickle
file with different sets of authorities should work across upgrades: if
a known authority is missing, the default value will be used; if an
unknown authority is present, it will be ignored. This lets us alter
the set of known authorities via the build flag.
I have tested and Android maintains the "sync automatically" state for
an authority even when the authority is not present in the list of sync
checkboxes.
All in all, I'm not concerned about toggling the build flag multiple
times in the future. (If we backed out the updated pickling code, we
would need to handle pickle downgrades, but we already needed to handle
that.)
========
fc8936549a
Author: Nick Alexander <nalexander@mozilla.com>
Date: Wed Feb 11 10:37:34 2015 -0800
Bug 1123107 - Part 3: Include Reading List checkbox during account creation.
We are careful to show the checkbox only when the reading list service
is enabled.
========
c90ea353cc
Author: Nick Alexander <nalexander@mozilla.com>
Date: Wed Feb 11 10:31:15 2015 -0800
Bug 1123107 - Part 2: Thread authorities to sync automatically through sign up/sign in flow.
========
e0c4d20744
Author: Nick Alexander <nalexander@mozilla.com>
Date: Mon Feb 9 12:35:15 2015 -0800
Bug 1123107 - Part 1: Manage map of automatically synced authorities.
========
7f7e308190
Author: Nick Alexander <nalexander@mozilla.com>
Date: Mon Feb 9 11:54:54 2015 -0800
Bug 1123107 - Part 0: Remove "account needs to be enabled" warning in status activity.
As we move Sync to a model where a status checkbox sets whether a single
ContentProvider is synced, it no longer makes sense to message when the
"account" is not automatically syncing.
This is the approach we already take everywhere else we make a jar🫙 URI.
I've unified those places into GeckoJarReader, cleaned up imports, fixed a
typo, and wrote a trivial test for this case.
I made a few utility methods static to facilitate testing and future refactoring.
Centralizing reading list access logic will make Bug 1130461 much easier. This bug is the first part of that.
We follow the same pattern as for URLMetadata, TabsAccessor, and Searches; BrowserDB hands over a single class that's specialized to handle the Reading List.
This is the approach we already take everywhere else we make a jar🫙 URI.
I've unified those places into GeckoJarReader, cleaned up imports, fixed a
typo, and wrote a trivial test for this case.
I made a few utility methods static to facilitate testing and future refactoring.