Skip to content

[Feature] Stop React Native LogCat Monitor hangs when Quick Pick is canceled #2766

Description

@EmmaYuan1015

Summary

When running the Stop React Native LogCat Monitor command with multiple active monitors, canceling the device Quick Pick causes the command flow to hang instead of exiting gracefully.

Steps to Reproduce

Start LogCat monitor for at least two Android devices/emulators.
Open Command Palette and run React Native: Stop React Native LogCat Monitor.
In the Quick Pick list, press Esc (or click outside) to cancel selection.

Actual Behavior

The command does not complete and appears to hang.

Expected Behavior

The command should exit cleanly on cancel, without stopping any monitor and without leaving a pending operation.

Impact

Poor command UX when users cancel selection.
Potential confusion because command appears stuck.
Risk of lingering unresolved async operation in extension flow.

Root Cause

In the cancel branch, the command awaited a Promise that never resolves, which blocked completion.

Proposed Fix

Treat cancel as a normal user action.
Return early when selection is undefined.
Add null-safe handling in command execution path before monitor deletion.

Acceptance Criteria

Canceling Quick Pick exits immediately.
No monitor is removed on cancel.
No unresolved/pending command state after cancel.
Existing behavior for valid selection remains unchanged.

Regression Scope

Stop LogCat monitor command with single monitor.
Stop LogCat monitor command with multiple monitors and valid selection.
Cancel path from Quick Pick.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions