@xenon-device-management/xenon 1.1.19 → 1.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/src/device-utils.js +4 -7
- package/package.json +1 -1
package/lib/package.json
CHANGED
package/lib/src/device-utils.js
CHANGED
|
@@ -411,18 +411,15 @@ function updateDeviceList(host, hubArgument, tlsRejectUnauthorized) {
|
|
|
411
411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
412
412
|
const allExistingDevices = yield (0, device_service_1.getAllDevices)();
|
|
413
413
|
const devices = yield getDeviceManager().getDevices(allExistingDevices);
|
|
414
|
-
if (devices.length
|
|
415
|
-
|
|
416
|
-
|
|
414
|
+
if (devices.length > 0) {
|
|
415
|
+
// first thing first. Update device list in local list
|
|
416
|
+
yield (0, device_service_1.addNewDevice)(devices, host);
|
|
417
417
|
}
|
|
418
|
-
// log.debug(`Updating device list with ${JSON.stringify(devices)} devices`);
|
|
419
|
-
// first thing first. Update device list in local list
|
|
420
|
-
yield (0, device_service_1.addNewDevice)(devices, host);
|
|
421
418
|
// Prune any devices that are in our local DB for this host but NO LONGER discovered.
|
|
422
419
|
// This automatically cleans up disconnected Android devices safely, or filtered
|
|
423
420
|
// iOS simulators (e.g. when booted-simulators is turned on and a simulator shuts down)
|
|
424
421
|
const discoveredUdids = new Set(devices.map((d) => d.udid));
|
|
425
|
-
const staleLocalDevices = allExistingDevices.filter((d) => d.host === host && !discoveredUdids.has(d.udid));
|
|
422
|
+
const staleLocalDevices = allExistingDevices.filter((d) => (d.host === host || d.host.includes(`//${host}:`) || d.host.includes(`//${host}/`)) && !discoveredUdids.has(d.udid));
|
|
426
423
|
if (staleLocalDevices.length > 0) {
|
|
427
424
|
logger_1.default.info(`Removing ${staleLocalDevices.length} stale devices/simulators no longer discovered on this host.`);
|
|
428
425
|
yield (0, device_service_1.removeDevice)(staleLocalDevices.map((d) => ({ udid: d.udid, host: d.host })));
|
package/package.json
CHANGED