Log when client connects for an unknown device
Summary: We've seen this happen sometimes, e.g. when adb fails and we aren't showing any android devices, but the sdk still manages to connect. When we detect this, log an error so we can track how often it occurs. Reviewed By: passy Differential Revision: D13175639 fbshipit-source-id: b0f79b77ac04ad804e56448b3696a3ffeb30631e
This commit is contained in:
committed by
Facebook Github Bot
parent
1c1905b5a8
commit
d8d40ae49b
@@ -226,6 +226,16 @@ export default function reducer(
|
||||
selectedPlugin = userPreferredPlugin;
|
||||
}
|
||||
|
||||
const matchingDeviceForClient = state.devices.filter(
|
||||
device => payload.query.device_id === device.serial,
|
||||
);
|
||||
if (matchingDeviceForClient.length === 0) {
|
||||
console.error(
|
||||
new RecurringError(`Client initialised for non-displayed device`),
|
||||
payload.id,
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
clients: state.clients.concat(payload),
|
||||
|
||||
Reference in New Issue
Block a user