Commit 2558769b authored by Paula Vidas's avatar Paula Vidas Committed by Commit Bot

[SyncInvalidations] Don't refresh device info if provider is not ready.

When Sync starts, interested data types and the FCM token are written to
device info, and RefreshLocalDeviceInfo() is triggered. That can happen
before the device info provider gets initialized, which then causes the
check in SendLocalDataWithBatch() to fail.

Since local device info is sent when everything is initialized, we can
just ignore the request to refresh if the initialization is not
finished.

Bug: 1082115
Change-Id: I884e31853c3f9160ef960c01081b7c69aa9ce578
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2445169Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarRushan Suleymanov <rushans@google.com>
Commit-Queue: Paula Vidas <paulavidas@google.com>
Cr-Commit-Position: refs/heads/master@{#813160}
parent 2b90ea13
......@@ -230,7 +230,11 @@ void DeviceInfoSyncBridge::RefreshLocalDeviceInfo(base::OnceClosure callback) {
device_info_synced_callback_list_.push_back(std::move(callback));
}
SendLocalData();
// Device info cannot be synced if the provider is not initialized. When it
// gets initialized, local device info will be sent.
if (local_device_info_provider_->GetLocalDeviceInfo()) {
SendLocalData();
}
}
void DeviceInfoSyncBridge::OnSyncStarting(
......
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