Skip to content

Commit 24b93a9

Browse files
authored
Merge branch 'main' into accessibility-audit-service
2 parents f28b580 + 2c92ef9 commit 24b93a9

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [5.14.4](https://github.com/appium/appium-ios-remotexpc/compare/v5.14.3...v5.14.4) (2026-08-12)
2+
3+
### Bug Fixes
4+
5+
* **afc:** make walk tolerant to untraversable directories ([#292](https://github.com/appium/appium-ios-remotexpc/issues/292)) ([ac6959b](https://github.com/appium/appium-ios-remotexpc/commit/ac6959bd413ce4b7685895d3c024c0861be17b7f))
6+
17
## [5.14.3](https://github.com/appium/appium-ios-remotexpc/compare/v5.14.2...v5.14.3) (2026-08-11)
28

39
### Bug Fixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "appium-ios-remotexpc",
3-
"version": "5.14.3",
3+
"version": "5.14.4",
44
"description": "",
55
"keywords": [],
66
"bugs": {

src/services/ios/afc/index.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,14 +479,33 @@ export class AfcService {
479479
log.debug(`Successfully pushed file to '${remoteDst}'`);
480480
}
481481

482+
/**
483+
* Recursively list `root` and everything below it. Untraversable directories are skipped
484+
* rather than aborting the walk: the media sandbox exposes directories it refuses to read
485+
* (e.g. `/PhotoData/UBF` answers GET_FILE_INFO but fails READ_DIR with PERM_DENIED).
486+
*/
482487
async walk(root: string): Promise<Array<{dir: string; dirs: string[]; files: string[]}>> {
483488
const out: Array<{dir: string; dirs: string[]; files: string[]}> = [];
484-
const entries = await this.listdir(root);
489+
let entries: string[];
490+
try {
491+
entries = await this.listdir(root);
492+
} catch (error) {
493+
log.debug(`Skipping '${root}' during walk, cannot list it:`, error);
494+
return out;
495+
}
485496
const dirs: string[] = [];
486497
const files: string[] = [];
487498
for (const e of entries) {
488499
const p = path.posix.join(root, e);
489-
if (await this.isdir(p)) {
500+
let isDir: boolean;
501+
try {
502+
isDir = await this.isdir(p);
503+
} catch (error) {
504+
// Unstattable entry: report it, but do not try to descend into it.
505+
log.debug(`Cannot stat '${p}' during walk, treating it as a file:`, error);
506+
isDir = false;
507+
}
508+
if (isDir) {
490509
dirs.push(e);
491510
} else {
492511
files.push(e);

0 commit comments

Comments
 (0)