Index: sync/engine/apply_control_data_updates.cc |
diff --git a/sync/engine/apply_control_data_updates.cc b/sync/engine/apply_control_data_updates.cc |
index 3e167b1e547aafddbe5e0da498212ea2271f9f5d..49825b8385aa0dd9baf45d748bd9ac0c39ebc635 100644 |
--- a/sync/engine/apply_control_data_updates.cc |
+++ b/sync/engine/apply_control_data_updates.cc |
@@ -32,13 +32,25 @@ void ApplyControlDataUpdates(syncable::Directory* dir) { |
ModelTypeSet control_types = ControlTypes(); |
for (ModelTypeSet::Iterator iter = control_types.First(); iter.Good(); |
iter.Inc()) { |
- syncable::MutableEntry entry(&trans, syncable::GET_TYPE_ROOT, iter.Get()); |
+ ModelType type = iter.Get(); |
+ syncable::MutableEntry entry(&trans, syncable::GET_TYPE_ROOT, type); |
if (!entry.good()) |
continue; |
- if (!entry.GetIsUnappliedUpdate()) |
+ |
+ if (!entry.GetIsUnappliedUpdate()) { |
Nicolas Zea
2015/10/09 22:23:33
Is this the right condition? The first time we dow
stanisc
2015/10/10 00:44:18
This case is to handle only locally created root n
|
+ // If this is a type with client generated root, the root node has been |
+ // created locally and might never be updated by the server. In that case |
+ // it has to be marked as having the initial download completed (which is |
+ // done by changing the root's base version to a value other than |
+ // CHANGES_VERSION). This does nothing if the root's base version is |
+ // already other than CHANGES_VERSION. |
+ if (IsTypeWithClientGeneratedRoot(type)) { |
+ dir->MarkInitialSyncEndedForType(&trans, type); |
+ } |
continue; |
+ } |
- ModelType type = entry.GetServerModelType(); |
+ DCHECK_EQ(type, entry.GetServerModelType()); |
if (type == NIGORI) { |
// Nigori node applications never fail. |
ApplyNigoriUpdate(&trans, |