Skip to content

Commit

Permalink
Merge pull request #1079 from brave/get-all-sync-data
Browse files Browse the repository at this point in the history
Remove GetAllSyncData workaround for local overridden issue
  • Loading branch information
darkdh committed Dec 13, 2018
1 parent 5d5a411 commit 2db9181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions components/brave_sync/client/bookmark_change_processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,7 @@ void BookmarkChangeProcessor::GetAllSyncData(
resolved_record->first = jslib::SyncRecord::Clone(*record);
auto* node = FindByObjectId(bookmark_model_, record->objectId);
if (node) {
// only match unsynced nodes so we don't accidentally overwrite
// changes from another client with our local changes
// TODO(darkdh): remove this hack once sync library can diffenrentiate
// records by syncTimstamp
if (IsUnsynced(node) ||
record->action != jslib::SyncRecord::Action::A_UPDATE) {
resolved_record->second = BookmarkNodeToSyncBookmark(node);
}
}

records_and_existing_objects->push_back(std::move(resolved_record));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ TEST_F(BraveBookmarkChangeProcessorTest, GetAllSyncData) {

EXPECT_PRED_FORMAT2(AssertSyncRecordsBookmarkEqual,
records_to_resolve.at(0).get(), pair_at_0->first.get());
// UPDATE now can be resolved to nullptr in some cases
EXPECT_EQ(pair_at_0->second.get(), nullptr);
EXPECT_PRED_FORMAT2(AssertSyncRecordsBookmarkEqual,
records.at(1).get(), pair_at_0->second.get());

const auto& pair_at_1 = records_and_existing_objects.at(1);
EXPECT_PRED_FORMAT2(AssertSyncRecordsBookmarkEqual,
Expand Down

0 comments on commit 2db9181

Please sign in to comment.