Summary
stopLogCatMonitor hangs indefinitely when the user cancels the device-selection QuickPick. The code uses await new Promise(() => {}) as a placeholder (marked #todo!>selectionHandling>), which leaves the command permanently pending instead of exiting cleanly. No unit tests exist for this command.
Why this is useful
Users who accidentally open the Stop LogCat Monitor command and press Escape are silently blocked — the command never completes and no error is shown. Fixing this makes the command behave consistently with other command-palette flows that handle QuickPick cancellation with a clean early return.
Suggested scope
- Replace
await new Promise(() => {}) with an early return (or an explicit cancellation notice) in selectLogCatMonitor at src/extension/commands/stopLogCatMonitor.ts:39
- Add unit tests covering:
- No monitors running →
AndroidCouldNotFindActiveLogCatMonitor error thrown
- Exactly one monitor running → monitor deleted without showing QuickPick
- Multiple monitors running, user selects one → selected monitor deleted
- Multiple monitors running, user cancels QuickPick → command exits cleanly, no monitor deleted
Evidence
Validation
- Run the new unit tests:
npm test (mocha suite for stopLogCatMonitor)
- Manually open "Stop React Native LogCat Monitor" with multiple active monitors and press Escape — command should exit without hanging
Summary
stopLogCatMonitorhangs indefinitely when the user cancels the device-selection QuickPick. The code usesawait new Promise(() => {})as a placeholder (marked#todo!>selectionHandling>), which leaves the command permanently pending instead of exiting cleanly. No unit tests exist for this command.Why this is useful
Users who accidentally open the Stop LogCat Monitor command and press Escape are silently blocked — the command never completes and no error is shown. Fixing this makes the command behave consistently with other command-palette flows that handle QuickPick cancellation with a clean early return.
Suggested scope
await new Promise(() => {})with an earlyreturn(or an explicit cancellation notice) inselectLogCatMonitoratsrc/extension/commands/stopLogCatMonitor.ts:39AndroidCouldNotFindActiveLogCatMonitorerror thrownEvidence
src/extension/commands/stopLogCatMonitor.tslines 37–42:#todo!>selectionHandling>comment withawait new Promise(() => {})as the cancel pathtest/extension/commands/forstopLogCatMonitorValidation
npm test(mocha suite forstopLogCatMonitor)