Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 05353e14 authored by Simon Chan's avatar Simon Chan
Browse files

fix(adb): `sync#opendir` should ignore errors (regression)

parent 879ffcbb
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -35,7 +35,15 @@ export async function* adbSyncOpenDir(
): AsyncGenerator<AdbSyncEntry, void, void> {
    if (v2) {
        await adbSyncWriteRequest(writer, AdbSyncRequestId.List2, path);
        yield* adbSyncReadResponses(stream, AdbSyncResponseId.Entry2, AdbSyncEntry2Response);
        for await (const item of adbSyncReadResponses(stream, AdbSyncResponseId.Entry2, AdbSyncEntry2Response)) {
            // `LST2` can return error codes for failed `lstat` calls.
            // `LIST` just ignores them.
            // But they only contain `name` so still pretty useless.
            if (item.error !== 0) {
                continue;
            }
            yield item;
        }
    } else {
        await adbSyncWriteRequest(writer, AdbSyncRequestId.List, path);
        for await (const item of adbSyncReadResponses(stream, AdbSyncResponseId.Entry, AdbSyncEntryResponse)) {