appium-ios-remotexpc 0.6.1 → 0.6.2
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.6.2](https://github.com/appium/appium-ios-remotexpc/compare/v0.6.1...v0.6.2) (2025-10-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* improve DNS resolution in bonjour service ([#78](https://github.com/appium/appium-ios-remotexpc/issues/78)) ([5cfda64](https://github.com/appium/appium-ios-remotexpc/commit/5cfda643f9e00de3d7e6da51f757ebb90e661757))
|
|
6
|
+
|
|
1
7
|
## [0.6.1](https://github.com/appium/appium-ios-remotexpc/compare/v0.6.0...v0.6.1) (2025-10-07)
|
|
2
8
|
|
|
3
9
|
### Miscellaneous Chores
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bonjour-discovery.d.ts","sourceRoot":"","sources":["../../../../src/lib/bonjour/bonjour-discovery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiB3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"bonjour-discovery.d.ts","sourceRoot":"","sources":["../../../../src/lib/bonjour/bonjour-discovery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiB3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC,CAAC;AAwXH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,OAAO,CAAC,cAAc,CAAC,CAAe;IACtC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA0C;IAE9E;;OAEG;IACG,aAAa,CACjB,WAAW,GAAE,MAA+C,EAC5D,MAAM,GAAE,MAA+B,GACtC,OAAO,CAAC,IAAI,CAAC;IAgBhB;;OAEG;IACH,YAAY,IAAI,IAAI;IAQpB;;OAEG;IACH,qBAAqB,IAAI,cAAc,EAAE;IAIzC;;OAEG;IACG,cAAc,CAClB,WAAW,EAAE,MAAM,EACnB,WAAW,GAAE,MAA+C,EAC5D,MAAM,GAAE,MAA+B,GACtC,OAAO,CAAC,cAAc,CAAC;IAoB1B;;OAEG;IACG,4BAA4B,CAChC,SAAS,GAAE,MAA2C,GACrD,OAAO,CAAC,aAAa,EAAE,CAAC;IAmB3B;;OAEG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAsBzC;;OAEG;YACW,kBAAkB;IA4BhC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuBhC;;OAEG;YACW,kBAAkB;IAuBhC;;OAEG;IACH,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logger } from '@appium/support';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
|
-
import {
|
|
3
|
+
import { lookup } from 'node:dns/promises';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
5
|
import { clearTimeout, setTimeout } from 'node:timers';
|
|
6
6
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
@@ -93,11 +93,21 @@ async function waitForProcessResult(process, timeoutMs, outputHandler, timeoutMe
|
|
|
93
93
|
log.debug(`[dns-sd] output: ${output}`);
|
|
94
94
|
try {
|
|
95
95
|
const handlerResult = outputHandler(output);
|
|
96
|
-
if (handlerResult
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
if (handlerResult) {
|
|
97
|
+
try {
|
|
98
|
+
process.kill('SIGTERM');
|
|
99
|
+
}
|
|
100
|
+
catch { }
|
|
101
|
+
clearTimeout(timeout);
|
|
102
|
+
isResolved = true;
|
|
103
|
+
if (handlerResult === true) {
|
|
104
|
+
resolve({ success: true });
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
result = handlerResult;
|
|
108
|
+
resolve({ success: true, data: result });
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
101
111
|
}
|
|
102
112
|
}
|
|
103
113
|
catch (error) {
|
|
@@ -226,25 +236,16 @@ function shouldSkipLine(line) {
|
|
|
226
236
|
* Resolve hostname to IP address
|
|
227
237
|
*/
|
|
228
238
|
async function resolveIPAddress(hostname) {
|
|
239
|
+
const clean = hostname.endsWith('.') ? hostname.slice(0, -1) : hostname;
|
|
229
240
|
try {
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
241
|
+
const results = await lookup(clean, { family: 4, all: true });
|
|
242
|
+
const list = Array.isArray(results) ? results : [results];
|
|
243
|
+
const addresses = list.map((r) => r.address);
|
|
244
|
+
log.info(`[ServiceResolver] Resolved ${clean} to IPv4: ${addresses}`);
|
|
245
|
+
return addresses;
|
|
233
246
|
}
|
|
234
247
|
catch (error) {
|
|
235
|
-
log.
|
|
236
|
-
// For .local hostnames, try without the trailing dot
|
|
237
|
-
if (hostname.endsWith('.local.')) {
|
|
238
|
-
const cleanHostname = hostname.slice(0, -1); // Remove trailing dot
|
|
239
|
-
try {
|
|
240
|
-
const address = await resolve4(cleanHostname);
|
|
241
|
-
log.info(`[ServiceResolver] Resolved ${cleanHostname} to IPv4: ${address}`);
|
|
242
|
-
return address;
|
|
243
|
-
}
|
|
244
|
-
catch (retryError) {
|
|
245
|
-
log.warn(`[ServiceResolver] Failed to resolve ${cleanHostname} to IPv4: ${retryError}`);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
+
log.debug(`[ServiceResolver] IPv4 lookup failed for ${clean}: ${error}`);
|
|
248
249
|
return undefined;
|
|
249
250
|
}
|
|
250
251
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logger } from '@appium/support';
|
|
2
2
|
import { type ChildProcess, spawn } from 'node:child_process';
|
|
3
|
-
import {
|
|
3
|
+
import { lookup } from 'node:dns/promises';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
5
|
import { clearTimeout, setTimeout } from 'node:timers';
|
|
6
6
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
@@ -173,10 +173,19 @@ async function waitForProcessResult<T>(
|
|
|
173
173
|
|
|
174
174
|
try {
|
|
175
175
|
const handlerResult = outputHandler(output);
|
|
176
|
-
if (handlerResult
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
if (handlerResult) {
|
|
177
|
+
try {
|
|
178
|
+
process.kill('SIGTERM');
|
|
179
|
+
} catch {}
|
|
180
|
+
clearTimeout(timeout);
|
|
181
|
+
isResolved = true;
|
|
182
|
+
if (handlerResult === true) {
|
|
183
|
+
resolve({ success: true });
|
|
184
|
+
} else {
|
|
185
|
+
result = handlerResult as T;
|
|
186
|
+
resolve({ success: true, data: result });
|
|
187
|
+
}
|
|
188
|
+
return;
|
|
180
189
|
}
|
|
181
190
|
} catch (error) {
|
|
182
191
|
hasError = true;
|
|
@@ -345,29 +354,15 @@ function shouldSkipLine(line: string): boolean {
|
|
|
345
354
|
async function resolveIPAddress(
|
|
346
355
|
hostname: string,
|
|
347
356
|
): Promise<string[] | undefined> {
|
|
357
|
+
const clean = hostname.endsWith('.') ? hostname.slice(0, -1) : hostname;
|
|
348
358
|
try {
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
const results = await lookup(clean, { family: 4, all: true });
|
|
360
|
+
const list = Array.isArray(results) ? results : [results];
|
|
361
|
+
const addresses = list.map((r) => r.address);
|
|
362
|
+
log.info(`[ServiceResolver] Resolved ${clean} to IPv4: ${addresses}`);
|
|
363
|
+
return addresses;
|
|
352
364
|
} catch (error) {
|
|
353
|
-
log.
|
|
354
|
-
`[ServiceResolver] Failed to resolve hostname ${hostname} to IPv4: ${error}`,
|
|
355
|
-
);
|
|
356
|
-
// For .local hostnames, try without the trailing dot
|
|
357
|
-
if (hostname.endsWith('.local.')) {
|
|
358
|
-
const cleanHostname = hostname.slice(0, -1); // Remove trailing dot
|
|
359
|
-
try {
|
|
360
|
-
const address = await resolve4(cleanHostname);
|
|
361
|
-
log.info(
|
|
362
|
-
`[ServiceResolver] Resolved ${cleanHostname} to IPv4: ${address}`,
|
|
363
|
-
);
|
|
364
|
-
return address;
|
|
365
|
-
} catch (retryError) {
|
|
366
|
-
log.warn(
|
|
367
|
-
`[ServiceResolver] Failed to resolve ${cleanHostname} to IPv4: ${retryError}`,
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
365
|
+
log.debug(`[ServiceResolver] IPv4 lookup failed for ${clean}: ${error}`);
|
|
371
366
|
return undefined;
|
|
372
367
|
}
|
|
373
368
|
}
|