Commit Graph
407 Commits
Author SHA1 Message Date
Michael Comella 12245a2234 Bug 1405404: Add 'de' to list of pocket whitelisted locales. r=liuche
This is used in multi-locale builds, e.g. [1] where all German is "de" but in
[2], we have a separate l10n repo for en-GB.

[1]: https://hg.mozilla.org/releases/l10n/mozilla-beta/de
[2]: https://hg.mozilla.org/releases/l10n/mozilla-beta/en-GB

MozReview-Commit-ID: CXw9aFH9psz
2017-10-03 10:29:49 -07:00
Michael Comella ae4d889f67 Bug 1404460: Add test for pocket locale enabling. r=liuche
MozReview-Commit-ID: LHdQuICvVjE
2017-10-02 18:36:41 -07:00
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
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
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
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
Michael Comella a84d1e8014 Bug 1388396 - bustage: Fix testBitmapNotScaledMoreThanTwoTimesTheSize. r=mcomella
MozReview-Commit-ID: BZ6dt5FE7FD
2017-09-13 10:35:40 -07:00
Michael Comella 1d8b37d839 Bug 1388396 - review: Add TestMinimumSizeProcessor. r=mcomella
MozReview-Commit-ID: ADaJL88YZLg
2017-09-12 11:33:33 -07:00
Michael Comella b1774c2156 Bug 1398368: Drop malformed Pocket Top Stories. r=liuche
I tested this through the unit tests I added.

In theory, we could also validate URLs to make sure they're valid but users
should see 404s if they're not valid so this seems like unnecessary code.

MozReview-Commit-ID: 3XqsMawLabj
2017-09-12 16:36:21 -07:00
Sebastian Hengst 7f90a07274 Backed out changeset 3300c15011d3 (bug 1388396) 2017-09-13 09:50:18 +02: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
Michael Comella 2e4193a6ec Bug 1388396 - review: Add TestMinimumSizeProcessor. r=mcomella
MozReview-Commit-ID: ADaJL88YZLg
2017-09-12 11:33:33 -07:00
Sebastian Kaspari eda242c262 Bug 1396604 - Remove content notifications code. r=JanH,nechen
MozReview-Commit-ID: 5H45Vjnzt5Z
2017-09-04 16:51:07 +02: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
Jan Henning ada6421382 Bug 1396292 - Part 1 - Provide facilities to explicitly run permissions check callbacks on the background thread. r=sebastian
The permissions check itself is synchronous, but if we then decide to prompt the user to acquire the permission, we have to do so asynchronously and eventually continue execution on the UI thread as a result. Therefore we need to provide a counterpart of onUIThread() for operations that want their callback to stay off the UI thread in all situations.

MozReview-Commit-ID: AOCX1v69R1J
2017-09-02 21:22:30 +02: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
Chenxia Liu d2953dc415 Bug 1393700 - Add test for parsing JSON response. r=mcomella
MozReview-Commit-ID: KTy3Mltrfg9
2017-08-28 16:40:39 -07:00
Grigory Kruglov 95e66b0765 Bug 1388884 - Do not delete bookmark tombstones r=rnewman
As implemented, this means we might upload tombstones for never-synced
bookmarks. This _should_ be harmless.

MozReview-Commit-ID: DZx9yWDs1ie
2017-08-29 14:01:14 -04: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
Sebastian Kaspari a4ac7ad615 Bug 1324028 - IconGenerator: Do not add alpha channel to colors of generated icons. r=mcomella
MozReview-Commit-ID: H4qaSSOlMxT
2017-08-08 17:36:50 +02:00
Sebastian Kaspari 62ab1d486e Bug 1363520 - Run CleanupAction from DownloadContentService. r=Grisha
MozReview-Commit-ID: FvnIYStD25u
2017-05-10 09:59:31 -07: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
Michael Comella 303c2718a4 Bug 1390372: Add URIUtils.isPathEmpty. r=liuche
MozReview-Commit-ID: G8rq6NL54mZ
2017-08-14 18:07:03 -07: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
Mehdi Soleimannejad f6d8d60ac9 Bug 1388112 - Force capitalisation from autocorrection result. r=JanH
MozReview-Commit-ID: 2wCgIpStQ52
2017-08-08 21:59:50 +04:30
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 7a87b51b9b Bug 1364644 - Bookmark version tracking r=rnewman
MozReview-Commit-ID: EdN4pYSR8Ux
2017-08-15 17:28:56 -04:00
Grigory Kruglov 7827d58772 Bug 1364644 - Migrate bookmarks schema and records to add version columns r=rnewman
Schema migration is simple: it adds localVersion and syncVersion columns to bookmarks table.
Default values are:
- localVersion=1
- syncVersion=0
... indicating that a record needs to be uploaded.

Data migration is also relatively simple: we need to ensure that records which are "up-to-date",
according to the old timestamp-based tracking, are not marked for an upload, and vice versa - records which are
either "new" or "changed" are marked for an upload.

Since our default during schema migration is to mark everything for upload, the data migration
concerns itself with the records which are considered as "up-to-date".

See detailed description in the comments in the data migration function.

MozReview-Commit-ID: J6aglurYwlo
2017-08-14 23:22:53 -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 e64c3855f7 Bug 1364644 - Pre: don't swallow runtime exceptions in the BrowserProvider's call interface r=rnewman
MozReview-Commit-ID: 3mgOrSvEFxU
2017-07-27 00:28:08 -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
Grigory Kruglov 726fc0b62b Bug 1364644 - Pre: Remove guidsSince RepositorySession interface r=rnewman
We're moving toward version-based syncing. This is one of the bricks in that road,
removing an unused timestamp-based interface for accessing changed records.

MozReview-Commit-ID: CYUyASWXrMW
2017-07-24 14:48:38 -04:00
Michael Comella 43a0e3cf01 Bug 1382332: Rm duplicate www. hosts from Highlights. r=liuche
MozReview-Commit-ID: L1F6ZuEsjwk
2017-08-10 17:12:15 -07:00
Michael Comella 0bb96f8063 Bug 1386902: Add URIUtils.getFormattedDomain. r=liuche
This combines getBaseDomain & getHostSecondLevel domain and allows us to be
more flexible.

MozReview-Commit-ID: 7FdWsfZvGFt
2017-08-10 15:21:42 -07:00
Edouard Oger 4eb3d9d631 Bug 1372655 - Notify other clients when uploading the local clients record for the first time. r=Grisha
MozReview-Commit-ID: HepBI6cbV3J
2017-08-03 16:10:40 -04:00
Grigory Kruglov 01d086f16b Bug 1386027 - Simplify handleError interfaces for SessionCallback and TelemetryCollector r=rnewman
Error reporting, and especially the split between per-stage and global session errors,
are a bit of a mess; at the very least, this patch unifies things a little bit, and
ensures we're not passing around nulls unexpectedly.

MozReview-Commit-ID: JTSp7GuOji0
2017-08-08 13:45:29 -04:00
Sebastian Kaspari 9d19ba5418 Bug 1383736 - Use full size icons in top sites (and highlights). r=mcomella
MozReview-Commit-ID: 39ri4ah1ned
2017-08-07 19:15:48 +02:00
Sebastian Hengst 6bd3c2bc0e Backed out changeset 4ecb1be113cb (bug 1363520) for Android build bustage at DownloadContentService.java:137: cannot find symbol. r=backout on a CLOSED TREE 2017-08-04 11:29:21 +02:00
Sebastian Kaspari 3a76f4e560 Bug 1363520 - Run CleanupAction from DownloadContentService. r=Grisha
MozReview-Commit-ID: FvnIYStD25u
2017-05-10 09:59:31 -07:00
kimsaehun a8546825e8 Bug 959033 - Don't send X-Confirm-Delete header with Android Sync requests. r=Grisha
MozReview-Commit-ID: AQqcfeX9TlA
2017-08-03 16:26:45 -07:00
Sebastian Kaspari 6838b93f8f Bug 1386305 - (DLC) Remove outdated bootstrap catalog. r=mcomella
The bootstrap catalog is outdated and downloading files from it returns in 404 errors from the CDN.
It's impossible to keep the bootstrap catalog updated. Instead let's start with an empty catalog
and rely on the latest catalog that we synchronize from Kinto.

MozReview-Commit-ID: FduZWJBvj16
2017-08-02 18:10:13 +02:00
Grigory Kruglov 2c6bdf48c1 Bug 1275423 - Update failing DSA signature tests r=nalexander
- use EOJ's handy .equals() to compare JSON structures
- generated DSA signature prefix seem to have changed post Java 1.8 update

MozReview-Commit-ID: JwQLb998Kro
2017-08-01 21:53:47 -04:00
Edouard Oger 3772920392 Bug 1351104 part 2 - Filter the clients list in Send Tab with the FxA device list. r=Grisha
MozReview-Commit-ID: KqSyWVfwva3
2017-06-07 16:24:30 -04:00
Michael Comella ab925f8d97 Bug 1369604: Replace features HashMap with indexing into an array. r=liuche
After the previous changeset, some numbers stood out:
- HighlightsRanking.extractFeatures: 44.9%
- HighlightCandidate.getFeatureValue: 19.4%
- Collections.secondaryHash: 17.3%
- HashMap.get: 11.7%

My hypothesis was that our HighlightCandidate.features implementation was slow:
it was mapping FeatureNames -> values in a HashMap but HashMap look-ups are
slower than a direct memory access.

I replaced the implementation with a direct access from an array - about as
fast as we can get. This encouraged me to make some changes with the following
benefits:
- Rewrote HighlightsRanking.normalize to save iterations and allocations.
- Rm code from HighlightsRanking.scoreEntries: we no longer need to iterate to
construct the filtered items, we just index directly into the list
- Rewrote HighlightsRanking.decay(), which I think is a little clearer now.
- Saved a few iterator/object allocations inside inner loops in places.

The tests pass and we have coverage for the normalize changes but not for
scoreEntries.

---

For perf, my changes affected multiple methods so the percentages are no longer
reliable but I can verify absolute runtime changes. I ran three tests, the best
of which showed an overall 33% runtime compared to the previous changeset and
the other two profiles showed a 66% overall runtime. In particular, for the
middle run, the changes for affected methods go from X microseconds to Y
microseconds:
- Features.get: 3,554,796 -> 322,145
- secondaryHash: 3,165,785 -> 35,253
- HighlightsRanking.normalize: 6,578,481 -> 1,734,078
- HighlightsRanking.scoreEntries: 3,017,272 -> 448,300

As far as I know, my changes should not have introduced any new inefficiencies
to the code.

MozReview-Commit-ID: 9THXe8KqBbB
2017-07-26 17:16:14 -07:00
Sebastian Hengst d37f5b706f Backed out changeset f23174dcc5e6 (bug 1369604) 2017-07-29 18:35:36 +02:00