Repository navigation
fix(adb): observe daemon startup notices emitted on stderr - #3073
viniciusdsandrade wants to merge 7 commits into
Conversation
…rser Signed-off-by: Vinícius DS Andrade <[email protected]>
Signed-off-by: Vinícius DS Andrade <[email protected]>
Signed-off-by: Vinícius DS Andrade <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Signed-off-by: Vinícius DS Andrade <[email protected]>
Signed-off-by: Vinícius DS Andrade <[email protected]>
…per fixture Signed-off-by: Vinícius DS Andrade <[email protected]>
# Conflicts: # tests/process-global/cleanLinuxHopperRuntime.test.ts
|
CI-fix track: none of the failures came from this PR. IDA native admission, the JavaScript semantic, endpoint and empty-literal tests, and the Hopper startup test all broke on main while it was red, and #3080 fixed them. I merged current main to clear the conflict in |
Recognize exact current and legacy ADB startup notices without treating stderr as device inventory or accepting error lookalikes. Fixes #3051. Reviewed-PR: #3073 Co-authored-by: Vinícius DS Andrade <[email protected]>
|
Superseded by |
Summary
list_adb_devices/list-adb-devicesreportsmay_have_started_adb_server: falseon the first query against a cold ADB server because daemon startup notices printed by ADB to stderr were not inspected byparseAdbDevicesOutput.Fixes #3051
Problem and expected behavior
When ADB runs
devices -lagainst a cold or stopped ADB server, modernadbbinaries (including platform-tools r34 and r37) emit daemon startup notices to stderr:while stdout receives the standard device table banner:
In
src/adb/AdbProvider.ts,runAdbcaptures both stdout and stderr, butlist_adb_devicespassed onlyran.value.stdouttoparseAdbDevicesOutput. Insrc/adb/AdbDeviceOutput.ts,parseAdbDevicesOutputonly accepted astdoutparameter. As a result, when ADB started a background server process during the device query,daemonStartedwas not detected, and the structured response reportedmay_have_started_adb_server: false.Expected behavior per
docs/adb-device-analysis.md: the ADB client starting its local server on first query is recorded in the tool result when observed (may_have_started_adb_server: true), while subsequent queries or runs against an already running server reportfalse. Unrecognized line reporting and device parsing continue to apply strictly to stdout.Change and scope
src/adb/AdbDeviceOutput.ts: updateparseAdbDevicesOutputto accept an optionalstderrparameter. WhendaemonStartedwas not found in stdout and stderr is non-empty, scan stderr lines for* daemon ... started successfullynotices. Device lines and unparsed line tracking continue to evaluate stdout only.src/adb/AdbProvider.ts: forwardran.value.stderralongsideran.value.stdoutintoparseAdbDevicesOutput.src/adb/AdbDeviceOutput.test.ts: add a unit test assertingdaemonStarted: truewhen daemon notices are emitted on stderr.src/adb/AdbProvider.test.ts: add a regression test assertingmay_have_started_adb_server: truewhen the stub prints daemon notices to stderr.Contract and boundary impact
src/adb/AdbDeviceOutput.tsand provider delegation insrc/adb/AdbProvider.ts.may_have_started_adb_serverboolean field.docs/public/product-catalog.json), package, or installation impact: none.Expected effects:
Evidence and regression coverage
src/adb/AdbDeviceOutput.test.ts: verifiesparseAdbDevicesOutputdetects daemon startup notices from stderr while parsing stdout devices.src/adb/AdbProvider.test.ts: verifieslist_adb_devicesreturnsmay_have_started_adb_server: truewhen adb prints daemon startup notices to stderr.list_adb_devicespasses only stdout toparseAdbDevicesOutput, so daemon startup notices on stderr leavemay_have_started_adb_server: false.may_have_started_adb_server: truewhen the first query against a cold adb server starts a background server.For evidence-bearing changes:
Validation performed
Compatibility, safety, and release
Before merge
type(scope): outcome.