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

Unified Diff: sync/engine/conflict_resolver.cc

Issue 1664643003: Change sync conflict resolution for extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added comments and unit test Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sync/engine/syncer_unittest.cc » ('j') | sync/engine/syncer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/conflict_resolver.cc
diff --git a/sync/engine/conflict_resolver.cc b/sync/engine/conflict_resolver.cc
index 0af30977c331e8840fe7ef27a77362114de875af..f1f15914152f2d631122324a50d0f34f1d1eb941 100644
--- a/sync/engine/conflict_resolver.cc
+++ b/sync/engine/conflict_resolver.cc
@@ -115,8 +115,11 @@ void ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans,
// safely ignore the server changes as redundant.
// f) Otherwise, it's in general safer to ignore local changes, with the
// exception of deletion conflicts (choose to undelete) and conflicts
- // where the non_unique_name or parent don't match.
- if (!entry.GetServerIsDel()) {
+ // where the non_unique_name or parent don't match. Another exception is
Nicolas Zea 2016/02/11 23:41:50 nit: may as well put this into its own e) bullet
asargent_no_longer_on_chrome 2016/02/18 00:53:45 Done.
+ // the case of extensions and apps, where we want uninstalls to win over
+ // local modifications to avoid "back from the dead" reinstalls.
+ ModelType type = entry.GetModelType();
+ if (!entry.GetServerIsDel() || (type == EXTENSIONS || type == APPS)) {
// TODO(nick): The current logic is arbitrary; instead, it ought to be made
// consistent with the ModelAssociator behavior for a datatype. It would
// be nice if we could route this back to ModelAssociator code to pick one
« no previous file with comments | « no previous file | sync/engine/syncer_unittest.cc » ('j') | sync/engine/syncer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698