Skip to content

Commit

Permalink
fix(adb): fix AdbServerClient.waitFor returning immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Jan 23, 2024
1 parent fc9af95 commit 9b54fde
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libraries/adb/src/server/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,12 @@ export class AdbServerClient {
`wait-for-${type}-${state}`,
);

// `connect` resolves when server writes `OKAY`,
// but for this command the server writes `OKAY` after the condition is met.
await this.connect(service, options);
const socket = await this.connect(service, options);
const readable = new BufferedReadableStream(socket.readable);
await AdbServerClient.readOkay(readable);

await readable.cancel();
await socket.close();
}

async createTransport(
Expand Down

0 comments on commit 9b54fde

Please sign in to comment.