Commit ab5c383a authored by pavely's avatar pavely Committed by Commit bot

[Sync] Stop setting SyncEntity.insert_after_item_id in client

Currently client sets insert_after_item_id, but doesn't properly order commit
entries with respect to this field. It causes commit to fail on the server under
certain conditions:
- Two new sibling bookmarks are committed
- They get broken into different commit messages with second bookmark being sent
  in the first message

In this case server either expects server id in the field or bookmark being
referred to in insert_after_item_id being present in the same message.

This field was deprecated since before M26, therefore I'm simply removing the
code that sets this field on the client.

BUG=722487
R=pnoland@chromium.org

Review-Url: https://codereview.chromium.org/2895933003
Cr-Commit-Position: refs/heads/master@{#473721}
parent b161bd62
......@@ -166,12 +166,8 @@ void BuildCommitItem(const syncable::Entry& meta_entry,
if (meta_entry.GetIsDel()) {
sync_entry->set_deleted(true);
} else {
// Both insert_after_item_id and position_in_parent fields are set only
// for legacy reasons. See comments in sync.proto for more information.
const Id& prev_id = meta_entry.GetPredecessorId();
string prev_id_string =
prev_id.IsNull() ? string() : prev_id.GetServerId();
sync_entry->set_insert_after_item_id(prev_id_string);
// position_in_parent field is set only for legacy reasons. See comments
// in sync.proto for more information.
sync_entry->set_position_in_parent(
meta_entry.GetUniquePosition().ToInt64());
meta_entry.GetUniquePosition().ToProto(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment