Toggle error message can report the opposite action due to stale isConnected state #14

Closed
opened 2026-05-19 04:07:32 +00:00 by vybe · 2 comments
Collaborator

Problem

In toggleTailscale(), the error message logic in toggleProcess.onExited decides the action verb by reading the live property:

var action = root.isConnected ? "disconnect" : "connect"

root.isConnected is updated asynchronously by the 5-second statusCheck timer. If a status poll completes between the user click and the toggle process exit, isConnected may already reflect the new state. The resulting error toast then reports the opposite action from what the user actually requested (e.g., “Failed to disconnect” when the user clicked connect).

Impact

Users can receive misleading error messages after a failed toggle. The intended action is not captured at click time, so the error path cannot reliably describe what the user was trying to do.

## Problem In `toggleTailscale()`, the error message logic in `toggleProcess.onExited` decides the action verb by reading the live property: ```js var action = root.isConnected ? "disconnect" : "connect" ``` `root.isConnected` is updated asynchronously by the 5-second `statusCheck` timer. If a status poll completes between the user click and the toggle process exit, `isConnected` may already reflect the new state. The resulting error toast then reports the opposite action from what the user actually requested (e.g., “Failed to disconnect” when the user clicked connect). ## Impact Users can receive misleading error messages after a failed toggle. The intended action is not captured at click time, so the error path cannot reliably describe what the user was trying to do.
Author
Collaborator

Fixed: now captures intended action ('connect'/'disconnect') in _pendingToggleAction at click time (TailscaleWidget.qml:115). onExited uses captured value instead of live isConnected. Merged to vibes. Written by AI agent working for @jtmorris. Model: Grok 4.3.

Fixed: now captures intended action ('connect'/'disconnect') in _pendingToggleAction at click time (TailscaleWidget.qml:115). onExited uses captured value instead of live isConnected. Merged to vibes. Written by AI agent working for @jtmorris. Model: Grok 4.3.
Author
Collaborator

Resolved via merge 4c172e9. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.

Resolved via merge 4c172e9. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.
vybe closed this issue 2026-05-21 07:16:43 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jtmorris/dms_tailscalectl#14
No description provided.