From 16483967ac10a18be480eff2504712f03229dce9 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Fri, 28 Sep 2018 15:13:38 -0700 Subject: [PATCH] Pass base bookmark order when id == -1 because getBookmarkOrder doesn't accept empty order ``` [43043:775:0927/180914.936996:INFO:CONSOLE(0)] "Error in event handler: Error: Invalid previous and next orders: and at Object.module.exports.getBookmarkOrder (chrome-extension://nomlkjnggnifocmealianaaiobmebgil/extension/brave-sync/bundles/bundle.js:1:1173) at Object.ipc.on [as get-bookmark-order] (chrome-extension://nomlkjnggnifocmealianaaiobmebgil/extension/brave-sync/bundles/bundle.js:36:4305) at chrome-extension://nomlkjnggnifocmealianaaiobmebgil/extension/background.js:82:39", source: chrome-extension://nomlkjnggnifocmealianaaiobmebgil/_generated_background_page.html (0) ``` which will lead to `OnSaveBookmarkOrder` never get called so the next bookmark added will never find previous order. --- components/brave_sync/controller_impl.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/brave_sync/controller_impl.cc b/components/brave_sync/controller_impl.cc index 22ce78d13e8b..6cf7c8dd8d44 100644 --- a/components/brave_sync/controller_impl.cc +++ b/components/brave_sync/controller_impl.cc @@ -1175,6 +1175,7 @@ void ControllerImpl::BookmarkAdded( storage::ObjectMap::Type::Bookmark, std::to_string(next_item_id)); DCHECK(!next_item_order.empty()); } + LOG(ERROR) << "TAGAB prev_item_order="<