Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GetAllSyncData workaround for local overridden issue #1079

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -729,14 +729,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