New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 855770 link

Starred by 0 users

Issue metadata

Status: Duplicate
Merged: issue 892349
Owner:
Closed: Oct 5
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

DeviceSyncClient: Delay responding to SetSoftwareFeatureState until sync confirms success

Project Member Reported by khorimoto@chromium.org, Jun 22 2018

Issue description

DeviceSyncClient::SetSoftwareFeatureState() provides a way to toggle a feature on/off. However, its success/failure callback returns as soon as the call completes. This leaves us vulnerable to the following situation:

(1) DeviceSyncClient::SoftwareFeatureState() called to turn on feature A for device A.
(2) Call returns from Mojo service.
(3) Call returns to the client of DeviceSyncClient.
(4) Client calls GetSyncedDevices() and gets back a list of devices. In that list, device A does *NOT* have feature A enabled.
(5) Mojo service notifies DeviceSyncClient of synced devices.
(6) DeviceSyncClient updates its list of synced devices.

After step 4, the "new devices synced" callback will occur, but by that point, it may be too late. The client may have already synchronously accessed the synced devices during the small window where they were out of sync.

To correct this issue, we should wait until the success callback comes back from the Mojo service, then wait until the new synced devices list comes in, then invoke the original client's callback. We should also introduce a timeout here so that if there is some error in the service (i.e., Mojo service says that the original request was successful but a new sync never occurs), we do not tell the original client that the call was successful.
 
Labels: M-70
Cc: jessejames@chromium.org
Labels: Pri-2
Labels: -M-70 M-71
Labels: -Pri-2 Pri-3
Components: -UI>ProximityAuth UI>Multidevice
Mergedinto: 892349
Status: Duplicate (was: Assigned)
Merging this into  issue 892349 ; as part of the fix for that bug, I'll be implementing this logic.

Sign in to add a comment