Commit efe7c981 authored by Josh Nohle's avatar Josh Nohle Committed by Commit Bot

[DeviceSync v2] Fix error-code handling of GetFeatureStatuses results

Ensure that any error codes emitted from the feature status getter are
reflected in the high-level v2 DeviceSync result metrics. Before this
CL, all feature status getter errors were bucketed into the error code
kErrorMissingLocalDeviceFeatureStatuses. This caused some confusion in
b/169842107.

Change-Id: Ifd9373d5f4ad54e6e5b38f09fe1aaa329c1e5eaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2451592
Commit-Queue: Josh Nohle <nohle@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814048}
parent 26612e6e
...@@ -384,23 +384,24 @@ void CryptAuthDeviceSyncerImpl::OnGetFeatureStatusesFinished( ...@@ -384,23 +384,24 @@ void CryptAuthDeviceSyncerImpl::OnGetFeatureStatusesFinished(
CryptAuthDeviceSyncResult::ResultCode device_sync_result_code) { CryptAuthDeviceSyncResult::ResultCode device_sync_result_code) {
DCHECK_EQ(State::kWaitingForFeatureStatuses, state_); DCHECK_EQ(State::kWaitingForFeatureStatuses, state_);
// We require that the local device feature statuses are returned; the local
// device is needed in the registry.
if (!base::Contains(id_to_device_software_feature_info_map,
request_context_.device_id())) {
FinishAttempt(CryptAuthDeviceSyncResult::ResultCode::
kErrorMissingLocalDeviceFeatureStatuses);
return;
}
switch (CryptAuthDeviceSyncResult::GetResultType(device_sync_result_code)) { switch (CryptAuthDeviceSyncResult::GetResultType(device_sync_result_code)) {
case CryptAuthDeviceSyncResult::ResultType::kNonFatalError: case CryptAuthDeviceSyncResult::ResultType::kNonFatalError:
did_non_fatal_error_occur_ = true; did_non_fatal_error_occur_ = true;
FALLTHROUGH; FALLTHROUGH;
case CryptAuthDeviceSyncResult::ResultType::kSuccess: case CryptAuthDeviceSyncResult::ResultType::kSuccess:
// We require that the local device feature statuses are returned; the
// local device is needed in the registry.
if (!base::Contains(id_to_device_software_feature_info_map,
request_context_.device_id())) {
FinishAttempt(CryptAuthDeviceSyncResult::ResultCode::
kErrorMissingLocalDeviceFeatureStatuses);
return;
}
BuildNewDeviceRegistry(id_to_device_software_feature_info_map); BuildNewDeviceRegistry(id_to_device_software_feature_info_map);
AttemptNextStep(); AttemptNextStep();
return; return;
case CryptAuthDeviceSyncResult::ResultType::kFatalError: case CryptAuthDeviceSyncResult::ResultType::kFatalError:
FinishAttempt(device_sync_result_code); FinishAttempt(device_sync_result_code);
return; return;
......
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