Commit 0b65eeae authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[USS] Fix a hack for populating missing wallet_data client tags

This CL deals properly with the root node for wallet data. This node
is sent (at least) in integration tests for migration to USS.

Bug: 853688
Change-Id: I94f38e38a4f7db7a7e960e5205c64d7ad6cf49e7
Reviewed-on: https://chromium-review.googlesource.com/1238541
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593188}
parent 99ff5481
......@@ -603,12 +603,18 @@ void ClientTagBasedModelTypeProcessor::OnCommitCompleted(
// Returns an updates list that has client tag hashes populated for every
// update entity.
UpdateResponseDataList PopulateClientTags(
UpdateResponseDataList PopulateClientTagsForWalletData(
const ModelType& type,
ModelTypeSyncBridge* bridge,
const UpdateResponseDataList& updates) {
UpdateResponseDataList updates_with_client_tags;
for (const UpdateResponseData& update : updates) {
if (update.entity->parent_id == "0") {
// Ignore the permanent root node. Other places in this file detect them
// by having empty client tags; this cannot be used for wallet_data as no
// wallet_data entity has a client tag.
continue;
}
updates_with_client_tags.push_back(update);
updates_with_client_tags.back().entity =
update.entity->UpdateClientTagHash(GenerateSyncableHash(
......@@ -646,7 +652,8 @@ void ClientTagBasedModelTypeProcessor::OnUpdateReceived(
// fully use client tags, or to use a different processor.
// TODO(crbug.com/874001): Remove this feature-specific logic when the right
// solution for Wallet data has been decided.
pre_processed_updates = PopulateClientTags(type_, bridge_, updates);
pre_processed_updates =
PopulateClientTagsForWalletData(type_, bridge_, updates);
updates_to_process = &pre_processed_updates;
}
......
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