Commit Graph
368 Commits
Author SHA1 Message Date
Grigory Kruglov 7018d4f86f Bug 1404543 - Update copy and default values for 'sync over wi-fi' pref r=nalexander
Switching key name/default value means that we'll drop this pref for some _very_ early
adopters of this feature on the nightly channel, but that's why it's a nightly channel.

MozReview-Commit-ID: KtQmmFFPDPR
2017-10-02 15:25:40 -04:00
Grigory Kruglov e21b3d82b6 Bug 1404124 - Pickle account right after it's created r=eoger
This is a relative of Bug 988605, with an exception that instead of going the whole way
and ensuring pickled data is kept up-to-date as Nick proposed, this patch simply ensures that
we pickle as soon as possible, with a goal of eliminating pickle races. The end goal is to kill
off pickling entirely, and so the assumption here is that this workaround is good enough
in the meantime.

MozReview-Commit-ID: 7IjRH7KE2Z9
2017-09-28 18:44:59 -04:00
Grigory Kruglov 2e6029fa59 Bug 1403787 - Register FxA device with a default client name if we fail to obtain one r=eoger
MozReview-Commit-ID: 85uXkFhMPFG
2017-09-28 17:43:28 -04:00
Mehdi Soleimannejad 05bcfe25f7 Bug 802749 - Make background sync over metered connections optional. r=Grisha Kruglov
MozReview-Commit-ID: 4UhQqyxT90N
2017-09-22 10:25:26 +03:30
Grigory Kruglov 2337064d3e Bug 1403022 - Abort session on BatchingUploader failures r=rnewman
The main goal of these changes is to ensure we're not doing any unnecessary work
in the unahppy cases of BatchingUploader. We might fail in three general ways:
- encounter a 412 error
- encounter another type of HTTP error
- encounter a GUID in the "failed" array

Currently, in all of these cases, we de-facto abort the session, without performing
an actual abort. E.g. we won't commit a batch, we'll refuse to upload any still-flowing
records. This patch simplifies our unhappy-case behaviour: if something failed, actually
abort the session (triggering a shutdownNow of the work queues), declare store as failed, etc.

It's important to note that our "did the synchronization fail?" login in the SynchronizerSession
depends on the store failure counts, and so this patch maintains the "record failed to store"
delegate chain. However, these counts are largely meaningless. What does it mean to fail to store
50 records, if we abort on the 51st, and prevent the other 100 from flowing (and from being counted
as failed?).

This patch also fixes an omission in the verstion tracking logic:
- prior, if we encountered a record in the "failed" array, we'd continue on with the flow, won't upload
anything, mark the synchronization as failed, but we'd also call into 'onStoreCompleted' which will
trigger an update of syncVersion for outflowing records
- with this patch, we won't call into onStoreCompleted in the case above, and so won't update syncVersion
in case of such failures
- this is the correct behaviour for batching uploads (now enabled on all but one server), but possibly
non-optimal behaviour if batching isn't enabled. However, this behaviour should be safe from a data consistency
point of view regardless of the batching mode.

MozReview-Commit-ID: LIYCPaRX8JA
2017-09-26 17:36:22 -04:00
Wes Kocher 6a817dc1a5 Backed out changeset 5799b3ef8745 (bug 802749) at flod's request a=backout
MozReview-Commit-ID: INjvhFgmO9m
2017-09-25 23:08:20 -07:00
Mehdi Soleimannejad d279429d0e Bug 802749 - Make background sync over metered connections optional. r=Grisha Kruglov
MozReview-Commit-ID: 4UhQqyxT90N
2017-09-22 10:25:26 +03:30
Grigory Kruglov 79a2105f9d Bug 1373254 - Ensure onStoreFailed won't be called twice r=rnewman
MozReview-Commit-ID: 5IE7t5qs6VU
2017-09-25 20:01:14 -04:00
Sebastian Hengst 3325e01151 Backed out changeset 74b5dba16c23 (bug 802749) for Android bustage. r=backout 2017-09-25 00:54:47 +02:00
Mehdi Soleimannejad 23b4d52203 Bug 802749 - Make background sync over metered connections optional. r=Grisha Kruglov
MozReview-Commit-ID: 4UhQqyxT90N
2017-09-22 10:25:26 +03:30
Grigory Kruglov 913d97c275 Bug 1351673 - Use a single-threaded work queue to process batching downloader work items r=rnewman
Before we'd recurse instead while fetching multiple batches, overflowing the stack on older devices.

MozReview-Commit-ID: 37BG6zGBdn0
2017-09-21 16:53:03 -04:00
Sebastian Hengst 6ff190a2d1 Backed out changeset 9767e159a701 (bug 1351673) for failing android lint. r=backout 2017-09-21 11:17:32 +02:00
Grigory Kruglov 442781df35 Bug 1351673 - Use a single-threaded work queue to process batching downloader work items r=rnewman
Before we'd recurse instead while fetching multiple batches, overflowing the stack on older devices.

MozReview-Commit-ID: 37BG6zGBdn0
2017-09-20 22:21:02 -04:00
Phil Ringnalda 8800afa663 Backed out changeset 96dab44be3ba (bug 1351673) for Android build bustage
CLOSED TREE

MozReview-Commit-ID: 4XV7Be9AXmB
2017-09-20 18:56:18 -07:00
Grigory Kruglov 0f9acba627 Bug 1351673 - Use a single-threaded work queue to process batching downloader work items r=rnewman
Before we'd recurse instead while fetching multiple batches, overflowing the stack on older devices.

MozReview-Commit-ID: 37BG6zGBdn0
2017-09-20 19:59:23 -04:00
Grigory Kruglov 458109c90e Bug 1401318 - Make sure account won't be null when it's processed by Android APIs r=nalexander
MozReview-Commit-ID: EVHzQngUykm
2017-09-20 18:48:42 -04:00
Grigory Kruglov 019ebb5d72 Bug 1401773 - Revert checkboxes->switches changeover for SyncPrefs r=nalexander
MozReview-Commit-ID: 2RwcgomT5UG
2017-09-20 19:05:30 -04:00
Grigory Kruglov cf73e73536 Bug 1400742 - Remove per-account in-memory cache r=nalexander
1368147 added reading fxa.account.json into the unbundle() codepath for the cases
when the in-memory cache isn't populated. This surfaced a race condition:
pickling of the fxa.account.json file and running unbundle() (as triggered from various
parts of the UI, or othe SyncStatusObservers) will race, and if unbundle wins, it
will attempt to read a yet-to-be-created fxa.account.json file, and crash.

Fixing the race isn't trivial, but we can avoid it by removing the in-memory cache,
thus avoiding having to read the cache key from the pickled file (uid).

In-memory cache was added in response to caching/invalidation issues of set/getUserData,
see Bug 964854 for the history. The current thinking is that those problems are pre-API16,
which hopefully means that we shouldn't encounter them anymore, and thus can remove the
workaround entirely.

MozReview-Commit-ID: AfL2Jq4IlYT
2017-09-20 18:21:06 -04:00
Edouard Oger 987a578fcd Bug 1359279 - Renew GCM token/Push registration/FxA Registration on push registration expired. r=Grisha
MozReview-Commit-ID: HFDjBBt9CBA
2017-08-23 15:41:31 -04:00
Sebastian Hengst 6c306c6abb Backed out changeset 53e599ac1ed7 (bug 1359279) for android linting failure. r=backout 2017-09-21 00:07:06 +02:00
Edouard Oger a70b3da701 Bug 1359279 - Renew GCM token/Push registration/FxA Registration on push registration expired. r=Grisha
MozReview-Commit-ID: HFDjBBt9CBA
2017-08-23 15:41:31 -04:00
Mehdi Soleimannejad 3311a83c12 Bug 1401336 - Make user-initiated syncs ignore account sync settings. r=Grisha Kruglov
MozReview-Commit-ID: JkMQb5f0yVM
2017-09-20 17:03:14 +04:30
Grigory Kruglov 1d7016aaeb Bug 1398283 - Clean up Sync Preferences screen r=nalexander
MozReview-Commit-ID: GfdBBT2cSh7
2017-09-19 14:11:53 -04:00
Nick Alexander 5e6a4745fc Bug 1398283 - Pre: Remove unused fxaccount_remote_error_* strings. r=nalexander
(by nalexander, from Bug 1375571)

This is follow-up to Bug 1220892, which just forgot to remove these strings.

MozReview-Commit-ID: 2WLa0AC8BZp
2017-06-22 10:17:14 -07:00
Sebastian Hengst 53fd0fa9a3 Backed out changeset a3964204faf6 (bug 1398283) for failing android lint. r=backout 2017-09-19 20:07:39 +02:00
Sebastian Hengst 9911b3222c Backed out changeset 0408636c7ea9 (bug 1398283) 2017-09-19 20:07:03 +02:00
Grigory Kruglov c983040ecf Bug 1398283 - Clean up Sync Preferences screen r=nalexander
MozReview-Commit-ID: GfdBBT2cSh7
2017-09-18 19:24:36 -04:00
Nick Alexander 696e49849e Bug 1398283 - Pre: Remove unused fxaccount_remote_error_* strings. r=nalexander
(by nalexander, from Bug 1375571)

This is follow-up to Bug 1220892, which just forgot to remove these strings.

MozReview-Commit-ID: 2WLa0AC8BZp
2017-06-22 10:17:14 -07:00
Grigory Kruglov bcb244fdd8 Bug 1399904 - Surface detailed profile unpickling exceptions r=nalexander
MozReview-Commit-ID: Cr7F7haUpog
2017-09-14 13:29:12 -07:00
Grigory Kruglov e7ccd6e2bf Bug 1368147 - Support renaming an account in response to profileUpdate events r=nalexander,sebastian
MozReview-Commit-ID: 7rQzTN0jEWb
2017-09-12 19:09:00 -04:00
Grigory Kruglov f97dbbe992 Bug 1368147 - Migrate sync and reading list preferences to be keyed by account UID r=nalexander,sebastian
Due to how we access our prefs files (read: all over the place), the idea here is to perform the migration whenever
some component actually attempts to get the prefs. This guarantees that every consumer of prefs will receive the
correct version, and we won't accidentally duplicate our shared prefs either.

I would have preferred to just perform this migration at a set point.
We have a "services upgrade point" - FxAccountUpgradeReceiver - which receives a "package upgraded" intent and kicks
off some async work. Unfortunately, we can't guarantee that its tasks won't overlap with our uses of prefs
(either in the background or foreground code).

MozReview-Commit-ID: AWQ4IY7i32F
2017-09-12 16:00:37 -04:00
Grigory Kruglov 1617c5b7fa Bug 1368147 - Pre: Don't forget to call super.finalize in finalize override r=sebastian
MozReview-Commit-ID: B7gatdHlCDb
2017-08-30 20:35:33 -04:00
Grigory Kruglov e4d53eda97 Bug 1368147 - Pre: remove unused code r=sebastian
MozReview-Commit-ID: IeEHvmObCvE
2017-08-30 20:38:01 -04:00
Grigory Kruglov c160441bd4 Bug 1368147 - Pre: tighten up access levels in AndroidFxAccount r=sebastian
MozReview-Commit-ID: GowyLH7roFF
2017-08-30 20:37:53 -04:00
Edouard Oger 294c0c9a48 Bug 1373897 - Clear the succeeded records GUIDs list after each POST in non-batched mode. r=Grisha
MozReview-Commit-ID: 4VnYZc6gMkc
2017-08-30 16:46:41 -04:00
Grigory Kruglov 15056b846d Bug 1395703 - Make sure modifiedBySync CV field isn't passed to ContentProvider on updates r=rnewman
Comment from bugzilla on this ugly hack:

While processing bookmarks, we sometimes need to mark them for re-upload as we're inserting new ones or updating existing ones. For example, we might set or update a dateAdded field.
We perform insertions "in-bulk", and so we might be inserting some bookmarks which need to be re-uploaded, and some bookmarks which don't. We compile an array of ContentValue objects, and make a single call to our ContentProvider. This means we can't use a URI param to indicate our intent, and so a non-column field in ContentValues objects - modifiedFromSync - is set for those bookmarks which need special treatment during insertion.
Bug 1392802 added a similar mechanism for updating bookmarks. However, updates are done differently - currently, we perform a single call to our ContentProvider for each bookmark. Which means we _can_ use a URI field as a signaling mechanism, which is what that patch did. However, in haste I forgot to take into consideration existing signaling mechanism, which lead to update failures.
And so we're left with an even clumsier interface to our data store, with two ways to signal the same thing in different circumstances... A quick solution is to just make sure 'modifiedBySync' field never makes its way to contentprovider on updates; a more refined fix would probably modify update logic to use a ContentValues field for consistency... Either way, there's going to be something ugly, somewhere in the code.
I anticipate a lot of this code changing sometime soon in order to support better transactionality of bookmark syncing, and smarter merging, and so I'm inclined to just to the simple thing for now.

MozReview-Commit-ID: H10LFsqjbFY
2017-08-31 18:05:20 -04:00
Grigory Kruglov 4cd120acbf Bug 1392505 - Let RepositorySessions track their own lastFetch and lastStore timestamps r=rnewman
This patch moves some of the state tracking (fetchEnd/storeEnd timestamps) away from RecordsChannel
and into individual RepositorySessions. The core assumption behind this move is that
sessions are better suited to know when they were fetched from during this sync, and when they
were stored to.
Sessions are growing in complexity - local ones are wrapped in a buffer, remote
now support batching downloads and uploads. In order to hide these details, it's easier to let
sessions keep track of the fetch/store timestamps in the way that fits their implementations.

Instead of flowing these timestamps upwards from sessions and into the SynchronizerSession,
the latter now simply queries sessions at the end of their flows.

The default behavior if a certain operation wasn't performed - that is, if fetchEnd or storeEnd
aren't set during sync for a session - is to return timestamp persisted during the previous sync.

This allows us to skip certain flows (no remote data available), and ensure that we're always
using correct timestamps of the same origin for any given session.

Prior behaviour was to "make up" a timestamp at the RecordsChannel level in cases of certain
errors or skipped flows, which resulted in comparing timestamps of different origins on the consequent sync.

MozReview-Commit-ID: 2wqeTo7mhz3
2017-08-30 19:48:21 -04:00
Grigory Kruglov d671241fa6 Bug 1392505 - Pre: remove unused delegate interface r=rnewman
MozReview-Commit-ID: K93rK1pILky
2017-08-25 21:44:37 -04:00
Grigory Kruglov e492f83f07 Bug 1392802 - Increment localVersion while reconciling a bookmark if we modified its dateAdded t.s. r=rnewman
We might decide that there's an older dateAdded timestamp present for an incoming bookmark while processing it,
in which case we need to ensure that our changes will be uploaded.

MozReview-Commit-ID: BKLh4rYBiRu
2017-08-29 20:12:46 -04:00
Mark Hammond f07cbf7ee9 Bug 1392449 - introduce shouldReconcileRecords so reconcileRecords never returns null. r=Grisha
MozReview-Commit-ID: L0rsLmzNTRr
2017-08-29 17:31:10 +10:00
Grigory Kruglov c738b61654 Bug 1394073 - Call onStoreFailed in case last payload fails in the uploader r=rnewman
MozReview-Commit-ID: 9cRuevmqbLD
2017-08-25 21:41:35 -04:00
Grigory Kruglov 3fd2692974 Bug 1392716 - Clean up version map while de-duping records r=rnewman
This is meant as a stop-gap measure to stop the obviously bad thing from happening.

MozReview-Commit-ID: Gqvc32K04xD
2017-08-23 21:28:49 -04:00
Grigory Kruglov 74fdaf79c0 Bug 1392078 - More detailed strong assertions to help narrow down root cause r=rnewman
MozReview-Commit-ID: JSN9Q837u6R
2017-08-21 17:42:44 -04:00
Thom Chiovoloni a011426d1e Bug 1291822 - Part 2. Integrate bookmark validator into android sync flow r=Grisha
MozReview-Commit-ID: LMmHAcfhnD
2017-07-17 16:49:11 -04:00
Thom Chiovoloni 7007019a33 Bug 1291822 - Part 1. Implement bookmark client server validator r=Grisha
MozReview-Commit-ID: D84KLUSQbe6
2017-06-07 17:25:14 -04:00
Nevin Chen 7f40d4ed8d Bug 1366664t - Update color and layout. Hide splash screen if first seen. r=walkingice
MozReview-Commit-ID: EP6hQIGcdyo
2017-08-09 18:13:55 +08:00
Grigory Kruglov d9507b27ca Bug 1364644 - Post: remove AndroidBrowser prefix from class names r=rnewman
MozReview-Commit-ID: Bpgba2BR7hp
2017-08-14 21:21:29 -04:00
Grigory Kruglov c1faab4fb6 Bug 1364644 - Versioned syncing of bookmarks r=rnewman
MozReview-Commit-ID: 5IdRPUXMDPh
2017-08-16 21:02:21 -04:00
Grigory Kruglov 30fdc506cd Bug 1364644 - Pre: Refactor bookmark and history sessions to allow for different superclasses r=rnewman
Versioned syncing work later in the patch series introduces functionality that is best suited to live
within the RepositorySession inheritance chain.

We'd like to introduce a new RepositorySession subclass which individual RepositorySessions are able to
inherit. And that's when the current inheritance structure gets in the way: history and bookmarks both share
a superclass, and we'd like to only introduce this new functionality for bookmarks.
This makes our task, as stated, impossible without breaking apart the current inheritance structure.

This patch introduces a few "delegate" objects:
- SessionHelper
--> HistorySessionHelper
--> BookmarksSessionHelper

... which absorb most of the functionality from AndroidBrowserRepositorySession (removed) and bookmark and history
repository sessions.

This change is not functional - everything remains as before otherwise.

MozReview-Commit-ID: 7WwUmY3Wql7
2017-08-04 18:43:49 -04:00
Grigory Kruglov 22371d2254 Bug 1364644 - Pre: Move change tracking responsibilities into repositories r=rnewman
As part of moving toward versioned syncing, we need to start decoupling change tracking
concepts from parts of the system that facilitate flow of records. This allows us to track
what changed differently for different data types, while maintaining a consistent and predictable API.

A move toward that is to let repositories own determinining that a record has been modified.
Repositories are now asked to provide modified records, instead of a very specific "records modified since".

This patch does not change behaviour of the system: every repository still uses timestamp-based
change tracking to actually provide modified records to the caller. A changeover to version
tracking will come later in this series for bookmarks, and as part of Bug 1383894 for other repositories.

MozReview-Commit-ID: LQuWYdlNHpt
2017-07-28 17:15:22 -04:00