Граф коммитов

306 Коммитов

Автор SHA1 Сообщение Дата
Grigory Kruglov 933d747314 Bug 1365865 - Update set of default ciphers for API26+ r=nalexander
TLS_DHE_RSA_WITH_AES_128_CBC_SHA is no longer supported in API26+.

MozReview-Commit-ID: AtNf2xZh2Bz

--HG--
extra : rebase_source : fef7d2018e77a4a4a7594bf32de750c8fa39e2ea
2017-06-27 17:36:21 -04:00
friedger bd0bd7094d Bug 1217675 - Eliminate Honeycomb compatibility from Fennec code r=nalexander
Remove all references to Build.SDK_INT comparing 14 and lower

MozReview-Commit-ID: JdAjYvQ6mfX

--HG--
extra : rebase_source : f6cae8af84c26f42dcc02c133e7bc702f1af61e6
2017-06-10 08:57:55 +02:00
Grigory Kruglov 83aa322bb6 Bug 1229216 - Make Firefox Accounts "sign-in" flow default to sign-in, not registration r=nalexander
MozReview-Commit-ID: IM6FybTH6OX

--HG--
extra : rebase_source : 15fa2c0c535589c30599b2e34d22a689a46cc1bc
2017-06-09 14:27:31 -04:00
Grigory Kruglov 986de19758 Bug 1370221 - Don't try to serialize ExtendedJSONObject r=nalexander
MozReview-Commit-ID: 3Q4rD2Ljfc

--HG--
extra : rebase_source : 483dca7fe06acf1fbdcccfe9b9282041eeab2bf7
2017-06-06 14:15:31 -04:00
Grigory Kruglov 9c7b9b69cd Bug 1370656 - Don't re-use the same instance of TelemetryCollector between syncs r=nalexander
Parent class (FxAccountSyncAdapter) is essentially a singleton, and so we'd end up re-using class
fields between syncs, among them the collected telemetry data. It's cleaner and safer to move
ownership of TelemetryCollector into IntrumentedSessionCallback. With this change, telemetry
data is contained within and eventually emitted from a single owner object.

MozReview-Commit-ID: Abx13VmILcE

--HG--
extra : rebase_source : b68b44951361727015c2a10895e42f6a34806b27
2017-06-06 17:42:28 -04:00
Grigory Kruglov fd1e018417 Bug 1370111 - Post: More explicit global error handling for Sync Telemetry r=nalexander
While this patch does make it clearer that telemetry error handling could be factored better,
at least it gets us to a consistent usage pattern.

MozReview-Commit-ID: 4Oamt9D03Ue

--HG--
extra : rebase_source : da73247ae0a27ba6ae3d6ad0d8814c1e2249e722
2017-06-05 19:44:15 -04:00
Grigory Kruglov 3eecfb6932 Bug 1370111 - Set 'started' telemetry timestamp before attempting to talk to the Token Server r=nalexander
MozReview-Commit-ID: E0vN1NY10WA

--HG--
extra : rebase_source : fdf22f1cdc2a5eba3ada1339aeefcc23c2debfe7
2017-06-05 19:51:27 -04:00
Grigory Kruglov 30acdf7a94 Bug 1308337 - Post: Remove old background telemetry code r=nalexander
MozReview-Commit-ID: CONHqQWzB6c

--HG--
extra : rebase_source : d492bf600a105f8ae2ac57c9aea6a5fb1a55f4e7
2017-04-11 22:31:18 -04:00
Grigory Kruglov dc5518fc5c Bug 1308337 - Part 7: Instrument Crypto Keys stage r=nalexander
MozReview-Commit-ID: 8a9zKsdhkbv

--HG--
extra : rebase_source : c105a2a9b5fb7986c4114af21cb62e2c6abe23bd
2017-05-29 17:20:20 -04:00
Grigory Kruglov 77bca8c547 Bug 1308337 - Part 6: Instrument FetchInfoConfiguration stage r=nalexander
MozReview-Commit-ID: HvDWBVBxb5I

--HG--
extra : rebase_source : 5e884830eaf1004e98ec1f6bca923fc4c84d1068
2017-05-31 17:38:47 -04:00
Grigory Kruglov 31f9e82f6f Bug 1308337 - Part 5: Instrument FetchInfoCollectionsStage r=nalexander
MozReview-Commit-ID: 64jTO81tDpK

--HG--
extra : rebase_source : 801c9c27730c217c6cf2d6e2bf086ef78f36f3a4
2017-05-31 17:38:30 -04:00
Grigory Kruglov 627c7eaf6d Bug 1308337 - Part 4: Instrument FetchMetaGlobal stage r=nalexander
MozReview-Commit-ID: 6zXqgsAIajN

--HG--
extra : rebase_source : c4a10afafe83bbb404ad47a56b7c5c389c716dd6
2017-05-29 21:48:05 -04:00
Grigory Kruglov c4c33eaf1b Bug 1308337 - Part 3: Handle sync restarts during telemetry collection r=nalexander
The approach here is to simply mark current TelemetryCollector as having restarted.
The downside of this approach is that two technically separate syncs are combined into one
telemetry ping. However, the two syncs are logically connected to each other, and combining
their telemetry will make it easier to figure out why a restart occurred, as well as what
happened after the restart.

MozReview-Commit-ID: AtJbge2ulMz

--HG--
extra : rebase_source : 4f9efb83da8f31b2e0470df6538c67533872f23a
2017-05-30 19:46:31 -04:00
Grigory Kruglov 9535e628ad Bug 1308337 - Part 2: Instrument Clients engine r=nalexander
While this is a "named" stage, it doesn't follow the Repository<->Repository
semantics of other named stages, and so it needs to be instrumented separately.

MozReview-Commit-ID: IKrc5Fb1bYm

--HG--
extra : rebase_source : 59c83e44235101f76b42f0eced867ce7b9d5a464
2017-05-31 17:38:59 -04:00
Grigory Kruglov 1153de2299 Bug 1308337 - Part 1: Instrument named sync stages and broadcast collected telemetry r=nalexander
SyncAdapter owns a TelemetryCollector, which is passed into GlobalSession to be "filled up"
with telemtry data.

GlobalSession obtains instances of TelemetryStageCollector from the TelemetryCollector, and
passes them into individual stages. They are filled up with telemetry as stages are executed.

Stage errors are recorded in TelemetryStageCollector.
Various global errors are recorded in TelemetryCollector itself.

On completion (success, failure, abort), telemetry is "built" and broadcasted via LocalBroadcastManager.
TelemetryContract is used to establish a key convention between the "broadcaster" and whoever is
on the receiving end of this telemetry.

This patch instruments stages which follow the Repository<->Repository flow semantics. Other stages,
such as the clients stage, meta/globa, info/* and crypto/keys are instrumented separately in follow-up
patches.

MozReview-Commit-ID: 5VLRc96GLdV

--HG--
extra : rebase_source : 4c7a7e1fde2e32d401eb28c70b9f04fdbd148ffd
2017-05-31 17:38:14 -04:00
Grigory Kruglov cf21801c0a Bug 1308337 - Pre: Read hashedFxaUid from the token server r=nalexander
This is what we (and other platforms) use as part of telemetry payloads in place of either
our local FxA Device ID or the sync client ID.

Note that this server API is currently undocumented.
Parameter introduced in 2021994ca4

MozReview-Commit-ID: 64sY5RZ2ZxK

--HG--
extra : rebase_source : d1790feae1c0f46dc5f420aeed347da12a6ac85c
2017-05-26 17:44:42 -04:00
Grigory Kruglov 5e6e442c6e Bug 1308337 - Pre: Don't throw away store and fetch exceptions as they're encountered r=nalexander
We will need them later for telemetry reporting. For now we're just keeping the last exception which
we encountered (which agrees with desktop's behaviour), and Bug 1362208 explores follow-up work to
aggregate and count the exceptions as we see them.

MozReview-Commit-ID: 8yKkZVGJZ9e

--HG--
extra : rebase_source : 501ff746ecfb3022a0fe89844e307153bfdb5164
2017-05-26 17:44:27 -04:00
Grigory Kruglov 9c8d7b3d37 Bug 1308337 - Pre: More granular tracking of record flow between repositories r=nalexander
This patch:
- introduces a way to signal that a record has been reconciled; this is not a "flow control"
  event type, and must be used in addition to regular "recordStored" delegate call
- draws a clearer distinction between "attempted to store" and "stored, as reported by session's storage layer"

MozReview-Commit-ID: 99UbUJzu57w

--HG--
extra : rebase_source : d7424fec748b9a2d07d1c98b78ce89fd418750e4
2017-05-26 17:34:07 -04:00
Grigory Kruglov fdb45b29fc Bug 1308337 - Pre: clean up wrong annotation r=nalexander
It's not just used for testing, and annotation is causing IDE to highlight its uses in code as invalid.

MozReview-Commit-ID: JvzX2VgNKom

--HG--
extra : rebase_source : a16933121371818307329523916d35e82b2446c9
2017-04-11 22:22:28 -04:00
udara cd5f595a60 Bug 1367533 - Remove extra error logging during device disconnect on Android. r=eoger
MozReview-Commit-ID: wonLHOwwzP

--HG--
extra : rebase_source : 01a0723c88de1f45c57e0a8576f3f8e8304d5fec
2017-05-24 15:47:57 -04:00
Edouard Oger 37008cf22a Bug 1361534 - Fix typo in AndroidFxAccount. r=eoger
MozReview-Commit-ID: EhMWO9jmLJ8

--HG--
extra : rebase_source : 1ebf2aa1d3b51a53377f5c4e42c6ce2ed8cd8b26
2017-05-02 18:52:21 -04:00
Andrzej Hunt 135c35d919 Bug 1356693 - infer: fix RESOURCE_LEAK's in services r=Grisha
The primary issue is that we use a throwing InputStreamReader
constructor. If it throws, then any nested streams will be lost.
We can fix that by using the non-throwing InputStreamReader
constructor (which uses a Charset as the second parameter,
instead of a String which causes an Exception to be thrown
if it can't be parsed)

We also simplify some nested Stream's a little: most of the
Stream constructors don't throw, so there's no harm in not keeping
individual references to those that don't throw - and that
results in less Stream references for us to handle.

MozReview-Commit-ID: 2hyRFGVmGnU

--HG--
extra : rebase_source : 9d2b25997e0f71089c0ef56c0069cafe068f821e
2017-04-14 20:58:59 -07:00
Carsten "Tomcat" Book d7e4098cb8 Backed out changeset 6d26ad68f31f (bug 1356693)
--HG--
extra : rebase_source : 2f0adc16fa93b32d8183fa51b36cbb02e95597bd
2017-04-27 15:19:50 +02:00
Andrzej Hunt 1c5d02830f Bug 1356693 - infer: fix RESOURCE_LEAK's in services r=Grisha
The primary issue is that we use a throwing InputStreamReader
constructor. If it throws, then any nested streams will be lost.
We can fix that by using the non-throwing InputStreamReader
constructor (which uses a Charset as the second parameter,
instead of a String which causes an Exception to be thrown
if it can't be parsed)

We also simplify some nested Stream's a little: most of the
Stream constructors don't throw, so there's no harm in not keeping
individual references to those that don't throw - and that
results in less Stream references for us to handle.

MozReview-Commit-ID: 2hyRFGVmGnU

--HG--
extra : rebase_source : 15dd97d28012a017326b01ae8ddc370c7f1ec484
2017-04-14 20:58:59 -07:00
Edouard Oger 027e105cad Bug 1351805 part 3 - Refresh the remote devices list on Married/Engaged states. r=Grisha
MozReview-Commit-ID: 1Ktbtlzc1fI

--HG--
extra : rebase_source : 0d17b41e17b01f65d38be93b7b01be056c75f652
2017-04-19 17:45:49 -04:00
Edouard Oger 61034e9bd7 Bug 1351805 part 1 - Create a org.mozilla.gecko.fxa.devices package. r=Grisha,nalexander
MozReview-Commit-ID: FjJmRiHlqEg

--HG--
extra : rebase_source : 0342756d408c89c82e2afbf3c561fd2efad9cb4f
2017-04-07 11:56:38 -04:00
Wes Kocher c9b3f40856 Backed out 3 changesets (bug 1351805) for android Test failures a=backout
Backed out changeset da34da5f310a (bug 1351805)
Backed out changeset 430b56176e04 (bug 1351805)
Backed out changeset a3dfb4b9dc66 (bug 1351805)

MozReview-Commit-ID: AE4RcKV3akz
2017-04-25 12:47:59 -07:00
Edouard Oger dd3f4bde18 Bug 1351805 part 3 - Refresh the remote devices list on Married/Engaged states. r=Grisha
MozReview-Commit-ID: 1Ktbtlzc1fI

--HG--
extra : rebase_source : 2d52926ee1ba8511a32b5a9cfdc13cd04ef4bbb8
2017-04-19 17:45:49 -04:00
Edouard Oger 96c75ddc3d Bug 1351805 part 1 - Create a org.mozilla.gecko.fxa.devices package. r=Grisha,nalexander
MozReview-Commit-ID: FjJmRiHlqEg

--HG--
extra : rebase_source : 0342756d408c89c82e2afbf3c561fd2efad9cb4f
2017-04-07 11:56:38 -04:00
Edouard Oger 73ec204121 Bug 1349299 - Register device on FxA even on Push registration failure. r=Grisha
MozReview-Commit-ID: 3qDkm9iV9C0

--HG--
extra : rebase_source : 907538907f43fb911ad28222ceecdc38fb2feb24
2017-04-06 11:30:23 -04:00
Grigory Kruglov 68882a5021 Bug 1335198 - Add support for synchronizing bookmark creation date r=rnewman
Incoming records might be missing the dateAdded field, and so we perform some pre-processing:
- during reconciliation, dateAdded is set to the lowest of (remote lastModified, remote dateAdded, local dateAdded)
- during insertion, if dateAdded is missing it is set to lastModified

Whenever we modify dateAdded for a record during sync, we also bump its lastModified value. This will trigger an
upload of this record, and consequently a re-upload by clients which are able to provide an older dateAdded value.
It is possible that this might cause conflicts on other devices, but the expected likelyhood of that happening is low.


MozReview-Commit-ID: 3tDeXKSBgrO

--HG--
extra : rebase_source : 26cb13838df7a4adb6d4fe3c51f0ecf3fd2eda95
2017-04-18 18:04:45 -04:00
Grigory Kruglov 626ce95975 Bug 1350442 - Remove redundant storeDone from the RepositorySession class r=rnewman
Confusion between storeDone() and storeDone(long end) resulted in certain sessions (bookmarks
and form history) not overriding the current method. As a result, their final "flush the queue"
methods weren't being called by the buffering middleware.

This patch removes the storeDone(long end) method, making such confusion a non-issue.

Given that a lot of sessions tend to build up buffers which they need to then flush after a storeDone()
call, passing in a timestamp into that method doesn't make sense. Instead, let's supply a default
implementation in RepositorySession which calls onStoreCompleted(endTimestamp) with current time,
and allow sessions to override this method and own the onStoreCompleted(endTimestamp) call.

MozReview-Commit-ID: 84o7aAL8RPC

--HG--
extra : rebase_source : 41767ad502bd5ad8a0a487235bfdca8cf0d0c927
2017-03-31 19:00:13 -04:00
Grigory Kruglov 9d248590c8 Bug 1350442 - Use the main storeWorkQueue for failures in the buffering middleware r=rnewman
MozReview-Commit-ID: ByZtR5zSKZB

--HG--
extra : rebase_source : 9cef0ba0c76e0ef11a32585f1c73508f87337a02
2017-04-04 17:15:02 -04:00
Grigory Kruglov 2a7dc44081 Bug 1343726 - Ensure that bookmark folders are processed first by the uploader r=rnewman
Since we're uploading records atomically, order in which they're processed by the uploader
only matters if we want to do sanity checks on certain types of records. Server might still
preserve some of the order, but for our purposes here it shouldn't matter.

We'd like to ensure that we process the "mobile root" bookmark record along with other folder
records first, so that we increase our chances of avoiding making a failing network request if
that those records' payload is too large.

Sorting by bookmark type achieves this.

MozReview-Commit-ID: KrAs3zepaOk

--HG--
extra : rebase_source : 24f1d3d6aa2ee3b6777dc38abdd1e01aba5213c2
2017-03-15 14:12:13 -07:00
Grigory Kruglov b7266cbba2 Bug 1343726 - Respect max_record_payload_bytes limit while uploading records r=rnewman
If we try to upload a record whose payload BSO field is larger than the limit specified
by the server, fail that record during BatchingUploader's processing.

Consequently, Synchronizer will fail current sync stage and advance to the next.

Previous behaviour was to essentially rely on the server to fail our POST request,
at which point we'll fail current sync stage. So in a way, this is an optimization to
avoid making network requests which we know will fail.

MozReview-Commit-ID: 5aJRRNoUuXe

--HG--
extra : rebase_source : 18920cfe7b7599be1984c53ebc0c9897c98fb7d9
2017-03-15 13:51:31 -07:00
Grigory Kruglov a8810d8865 Bug 1352608 - Close a cursor after we're done with it r=eoger
Removed "final" because "safeQuery" provides terrible developer ergonomics.

MozReview-Commit-ID: 2F0XZnBM3Yv

--HG--
extra : rebase_source : 634c6f8cfc14cce8d15e2911d474086dc85c6db4
2017-03-31 20:22:06 -04:00
Ryan VanderMeulen f4a0d77ffc Merge inbound to m-c. a=merge 2017-03-29 09:41:54 -04:00
Grigory Kruglov 7443c95aab Bug 1350196 - Part 2: Perform PRNGFixes earlier. r=rnewman, r=nalexander
MozReview-Commit-ID: 18jnRRFhyPq

--HG--
extra : rebase_source : 703dd7ab2d67e522d36130fe1815c5d2610827de
2017-03-27 18:32:54 -07:00
Grigory Kruglov 719d2c720d Bug 1350196 - Part 1: Generate IV ourselves. r=rnewman, r=nalexander
MozReview-Commit-ID: 5rR8BQRcJoR

--HG--
extra : rebase_source : 0d474e3818f8b5abfd6c5904473cf3801a98b1cb
2017-03-27 18:40:02 -07:00
Edouard Oger 466b73fea5 Bug 1346061 part 3 - Trigger a sync/email-verification-check on empty FxA push message. r=Grisha,nalexander
MozReview-Commit-ID: ABUm6LZij4M

--HG--
extra : rebase_source : 4818f95bf7dbe3f1c9891f3aeb7ade4c83d58870
2017-03-22 13:10:09 -04:00
Edouard Oger 965ba52d24 Bug 1346061 part 2 - Register device on FxA on Engaged state. r=Grisha,nalexander
MozReview-Commit-ID: 3HrXePgBxg6

--HG--
extra : rebase_source : ba6f805c4f313a8c317dd71fa34511c4544f0a54
2017-03-22 13:11:34 -04:00
Edouard Oger b2e227a8e3 Bug 1346061 part 1 - Expose getSessionToken() on State. r=Grisha,nalexander
We need to access sessionToken in the Engaged state in order to perform device
registration. We expose getSessionToken() on the base State class, to allow
customers to get the sessionToken easily instead of having to downcast the
TokensAndKeysState/Engaged states.

MozReview-Commit-ID: 8s2C350noUG

--HG--
extra : rebase_source : e0bc8bf7ebfdcb7a31bb4a6ddb5b928acf7baba9
2017-03-22 13:07:00 -04:00
Edouard Oger b52bdd3388 Bug 1265314 - Set tabs record lastModified to clients.lastModified. r=nalexander
MozReview-Commit-ID: 84g7WXxRwdX

--HG--
extra : rebase_source : 3b041d9f3cb0b9285b5e7bad66a8f14f9c71410e
2017-03-24 15:40:34 -04:00
Grigory Kruglov e7b03d35b1 Bug 1346438 - Specify X-I-U-S header value as 0 when uploading crypto/keys r=nalexander
MozReview-Commit-ID: GTcZUdvVU8E

--HG--
extra : rebase_source : 14318877ae4d52384090e99e7668e1deb19f3408
2017-03-17 19:09:43 -07:00
Grigory Kruglov 8009760a1c Bug 1346438 - Specify X-I-U-S header value while uploading meta/global r=nalexander
We upload meta/global in three scenarios:
- fresh start
- when it was modified after a successful sync
- when it was modified after an aborted sync

Use X-I-U-S header to assert what we believe about meta/global's presence (during freshStart)
and last-modified timestamp (in all other cases).

We might encounter a concurrent modification condition, manifesting as a 412 error. If we see such an error:
- on fresh start, we restart globalSession
- on regular upload, we request a re-sync of all stages

MozReview-Commit-ID: 3qyb6rUSOeY

--HG--
extra : rebase_source : 166be44aceb634b4e9fa3a8e20f7047cfec2af54
2017-03-20 16:40:13 -07:00
Edouard Oger ec0e5f70b8 Bug 1254643 - Delete FxA device when Fennec Firefox Account is removed. r=Grisha
MozReview-Commit-ID: H4lJlXGYIBg

--HG--
extra : rebase_source : f5862b9591def7ee300c6f02ff7750ead043241a
2017-03-13 14:35:41 -04:00
Grigory Kruglov 4d75d6610b Bug 1346390 - Use Long.parseLong instead of Long.valueOf for efficiency r=nalexander
MozReview-Commit-ID: 29fwjlxRqZ3

--HG--
extra : rebase_source : 6f23bf647d8547a2f711d418ba2801c5059e0ab8
2017-03-10 13:17:51 -08:00
Grigory Kruglov 9c2a8e93e0 Bug 1329793 - Re-subscribe for a push channel periodically r=eoger,nalexander
On startup and at the beginning of a sync we check how long it has been since we've subscribed
to a channel for fxa service. If it's been over 21 days, request re-subscription.

MozReview-Commit-ID: GzvPecZ9hTy

--HG--
extra : rebase_source : d0292acddbdd231502808469d4e5502a4ac93779
2017-03-08 18:14:43 -08:00
Grisha Kruglov 8e54812b61 Bug 1291821 - Post: remove unused files r=rnewman
MozReview-Commit-ID: 4qM5vx4AQyQ

--HG--
extra : rebase_source : 5428e67f40947d58521b635cda86121d21ebe275
2016-11-29 13:36:26 -08:00
Grisha Kruglov 283d1a3450 Bug 1291821 - Allow BatchingDownloader to resume downloads using offset r=rnewman
BatchingDownloader uses provided RepositoryStateProvider instance in order to track
offset and high water mark as it performs batching.

The state holder objects are initialized by individual ServerSyncStages, and prefixes are used to ensure keys
won't clash.

Two RepositoryStateProvider implementations are used: persistent and non-persistent. Non-persistent
state provider does not allow for resuming after a sync restart, while persistent one does.

Persistent state provider is used by the history stage. It is fetched oldest-first, and records are applied
to live storage as they're downloaded. These conditions let use resume downloads. It's also possible to
resume downloads for stages which use a persistent buffer, but currently we do not have any.

Offset value and its context is reset if we hit a 412 error; it is maintained if we hit a sync deadline, allowing us to
minimize number of records we'll redownload. BatchingDownloaderController owns resuming and context checking logic.

High water mark (h.w.m.) is maintained across syncs and used instead of stage's "last-synced" timestamp if said stage is
set to fetch oldest-first and explicitely allows use of a h.w.m. Server15RepositorySession provides correct timestamp
to RecordsChannel, decoupling BatchingDownloader from this logic.

MozReview-Commit-ID: IH28YrDU4vW

--HG--
extra : rebase_source : 63bd7daaa1fd2a63e10289d6d4cd198aaf81498b
2017-01-19 13:11:18 -08:00