Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Issue 1778923003: Fix extensions sync in cases where items change type (Closed)

Created:
4 years, 9 months ago by asargent_no_longer_on_chrome
Modified:
4 years, 9 months ago
Reviewers:
Marc Treib, Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Devlin
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix extensions sync in cases where items change type If an extension changes into an app or vice versa, we can be left with an old sync data item even if the installed item is uninstalled. Then on the next sync, we'll try re-installing based on the id in this old record, so it becomes impossible to remove. The chrome webstore does not normally allow items to change type, but it has happened in a few cases, possibly either via their publishing API or one-off manual inteventions. A notable case is Google Hangouts, which started out as a packaged app and became an extension at some point. This CL changes the sync logic to always delete the sync data item if there is an installed item of a differing type. Previously, we only did this in the special case of themes due to a bug where themes could end up being recorded as extensions. Also, while working on tests for this CL I discovered some unit and browser tests where we were directly calling the ProcessSyncChanges method on ExtensionSyncService without first calling MergeDataAndStartSyncing, which is a violation of the expectations of the SyncableService interface, so I've fixed those and added a DCHECK to help prevent future occurences. BUG=590692 Committed: https://crrev.com/e48ab754b00bbb2dee227adebb8936b3b13be77c Cr-Commit-Position: refs/heads/master@{#380813}

Patch Set 1 #

Total comments: 13

Patch Set 2 : review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+239 lines, -18 lines) Patch
M chrome/browser/extensions/extension_disabled_ui_browsertest.cc View 1 3 chunks +13 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension_service_sync_unittest.cc View 1 8 chunks +184 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_sync_service.cc View 1 2 chunks +14 lines, -15 lines 0 comments Download
A chrome/test/data/extensions/sync_datatypes/key.pem View 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/sync_datatypes/v1.crx View Binary file 0 comments Download
A chrome/test/data/extensions/sync_datatypes/v2.crx View Binary file 0 comments Download

Messages

Total messages: 18 (10 generated)
asargent_no_longer_on_chrome
Sending to both treib and rdevlin.cronin since this sync stuff can be tricky and can ...
4 years, 9 months ago (2016-03-09 23:28:07 UTC) #3
asargent_no_longer_on_chrome
Oops, hit submit too early. treib: please review +cc devlin (for real this time) as ...
4 years, 9 months ago (2016-03-09 23:29:26 UTC) #4
Marc Treib
Nice! LGTM, but please wait for Devlin to double-check. History proves that I'm not very ...
4 years, 9 months ago (2016-03-10 10:36:34 UTC) #5
Devlin
lgtm https://codereview.chromium.org/1778923003/diff/1/chrome/browser/extensions/extension_service_sync_unittest.cc File chrome/browser/extensions/extension_service_sync_unittest.cc (right): https://codereview.chromium.org/1778923003/diff/1/chrome/browser/extensions/extension_service_sync_unittest.cc#newcode156 chrome/browser/extensions/extension_service_sync_unittest.cc:156: }; nit: DISALLOW_COPY_AND_ASSIGN https://codereview.chromium.org/1778923003/diff/1/chrome/browser/extensions/extension_service_sync_unittest.cc#newcode175 chrome/browser/extensions/extension_service_sync_unittest.cc:175: type, syncer::SyncDataList(), nit: ...
4 years, 9 months ago (2016-03-10 18:08:29 UTC) #7
asargent_no_longer_on_chrome
https://codereview.chromium.org/1778923003/diff/1/chrome/browser/extensions/extension_service_sync_unittest.cc File chrome/browser/extensions/extension_service_sync_unittest.cc (right): https://codereview.chromium.org/1778923003/diff/1/chrome/browser/extensions/extension_service_sync_unittest.cc#newcode108 chrome/browser/extensions/extension_service_sync_unittest.cc:108: syncer::SyncData sync_data = change.sync_data(); On 2016/03/10 10:36:34, Marc Treib ...
4 years, 9 months ago (2016-03-11 23:40:59 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1778923003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1778923003/20001
4 years, 9 months ago (2016-03-11 23:43:29 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 9 months ago (2016-03-12 00:59:29 UTC) #16
commit-bot: I haz the power
4 years, 9 months ago (2016-03-12 01:00:43 UTC) #18
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e48ab754b00bbb2dee227adebb8936b3b13be77c
Cr-Commit-Position: refs/heads/master@{#380813}

Powered by Google App Engine
This is Rietveld 408576698