@xenon-device-management/xenon 1.1.10 → 1.1.12

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {
@@ -60,12 +60,18 @@ let XenonManager = class XenonManager {
60
60
  this.init();
61
61
  }
62
62
  for (const deviceManager of this.deviceManagers) {
63
- devices.push(...(yield deviceManager.getDevices({
64
- androidDeviceType: this.context.pluginArgs.androidDeviceType,
65
- iosDeviceType: this.context.pluginArgs.iosDeviceType,
66
- }, existingDeviceDetails || [])).map((device) => {
67
- return Object.assign(Object.assign({}, device), { nodeId: !device.cloud ? this.context.nodeId : undefined });
68
- }));
63
+ try {
64
+ const discoveredDevices = yield deviceManager.getDevices({
65
+ androidDeviceType: this.context.pluginArgs.androidDeviceType,
66
+ iosDeviceType: this.context.pluginArgs.iosDeviceType,
67
+ }, existingDeviceDetails || []);
68
+ devices.push(...discoveredDevices.map((device) => {
69
+ return Object.assign(Object.assign({}, device), { nodeId: !device.cloud ? this.context.nodeId : undefined });
70
+ }));
71
+ }
72
+ catch (err) {
73
+ this.log.error(`Device manager ${deviceManager.constructor.name} failed to get devices: ${err.message || err}`);
74
+ }
69
75
  }
70
76
  return devices;
71
77
  });
@@ -213,14 +213,22 @@ let IOSDiscoveryService = class IOSDiscoveryService {
213
213
  console.log('[POISON PILL] REAL fetchLocalSimulators CALLED IN TEST MODE!');
214
214
  }
215
215
  const simctl = new node_simctl_1.default();
216
- const list = yield simctl.list();
217
- // Log unavailable runtimes
218
- list.runtimes
219
- .filter((r) => !r.isAvailable)
220
- .forEach((r) => this.log.error(`Runtime not available: ${r.name}`));
221
- const iosSims = (0, lodash_1.flatten)(Object.values((yield simctl.getDevicesByParsing('iOS'))));
222
- const tvosSims = (0, lodash_1.flatten)(Object.values((yield simctl.getDevicesByParsing('tvOS'))));
223
- let simulators = [...iosSims, ...tvosSims];
216
+ let simulators = [];
217
+ try {
218
+ const list = yield simctl.list();
219
+ // Log unavailable runtimes
220
+ if (list && list.runtimes) {
221
+ list.runtimes
222
+ .filter((r) => !r.isAvailable)
223
+ .forEach((r) => this.log.error(`Runtime not available: ${r.name}`));
224
+ }
225
+ const iosSims = (0, lodash_1.flatten)(Object.values((yield simctl.getDevicesByParsing('iOS'))));
226
+ const tvosSims = (0, lodash_1.flatten)(Object.values((yield simctl.getDevicesByParsing('tvOS'))));
227
+ simulators = [...iosSims, ...tvosSims];
228
+ }
229
+ catch (e) {
230
+ this.log.error(`Failed to fetch local simulators: ${e.message || e}`);
231
+ }
224
232
  if (this.pluginArgs.bootedSimulators) {
225
233
  simulators = simulators.filter((d) => d.state === 'Booted');
226
234
  }
package/lib/src/index.js CHANGED
@@ -52,6 +52,7 @@ Object.defineProperty(exports, "XenonPlugin", { enumerable: true, get: function
52
52
  const ffmpeg_1 = require("@ffmpeg-installer/ffmpeg");
53
53
  const logger_1 = __importDefault(require("./logger"));
54
54
  const typedi_1 = require("typedi");
55
+ const lodash_1 = __importDefault(require("lodash"));
55
56
  // Add FFMPEG to path for appium to record video of the session
56
57
  process.env.PATH = process.env.PATH + ':' + ffmpeg_1.path.replace(/ffmpeg$/g, '');
57
58
  /**
@@ -88,7 +89,9 @@ process.on('unhandledRejection', (reason, promise) => {
88
89
  logger_1.default.error('❌ [Xenon] Unhandled Rejection at:', promise, 'reason:', reason);
89
90
  });
90
91
  process.on('uncaughtException', (err) => {
91
- logger_1.default.error('❌ [Xenon] Uncaught Exception:', err);
92
+ const errorDetails = err instanceof Error ? Object.assign({ name: err.name, message: err.message, stack: err.stack }, (lodash_1.default.omit(err, ['name', 'message', 'stack']))) : err;
93
+ logger_1.default.error('❌ [Xenon] Uncaught Exception:', JSON.stringify(errorDetails, null, 2));
94
+ logger_1.default.error('❌ [Xenon] Stack Trace:', err instanceof Error ? err.stack : new Error().stack);
92
95
  // Give logger time to flush before exiting
93
96
  setTimeout(() => process.exit(1), 1000);
94
97
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenon-device-management/xenon",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Xenon - Intelligent Mobile Infrastructure. A self-healing device orchestration platform for Appium.",
5
5
  "main": "./lib/src/index.js",
6
6
  "exports": {