Skip to content

Commit

Permalink
Send other_node children moving records for other desktops to catch up
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Feb 4, 2020
1 parent 89160f5 commit 4d683e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/brave_sync/brave_profile_sync_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ void BraveProfileSyncServiceImpl::ProcessOtherBookmarksFolder(

// Add records to move direct children of other_node to this new folder
// with existing object id of the old "Other Bookmarks" folder
auto records_to_send = std::make_unique<RecordsList>();
for (size_t i = 0; i < model_->other_node()->children().size(); ++i) {
auto sync_record =
BookmarkNodeToSyncBookmark(model_->other_node()->children()[i].get());
Expand All @@ -872,10 +873,17 @@ void BraveProfileSyncServiceImpl::ProcessOtherBookmarksFolder(
bookmark.order + "." + std::to_string(i + 1);
LoadSyncEntityInfo(sync_record.get());

auto record_to_send = SyncRecord::Clone(*sync_record);

// Append chnages to remote records
if (!pending_received_records_)
pending_received_records_ = std::make_unique<RecordsList>();
pending_received_records_->push_back(std::move(sync_record));

// Send changes to other desktops
records_to_send->push_back(std::move(record_to_send));
}
SendSyncRecords(jslib_const::SyncRecordType_BOOKMARKS, std::move(records_to_send));
}
}
}
Expand Down

0 comments on commit 4d683e0

Please sign in to comment.