Duplicate state-reset logic in statusCheck catch vs onExited (minor maintainability) #31

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

Problem

Both the catch block (JSON parse failure) and the onExited(code !== 0) handler in statusCheck perform the same four property resets:

  • peers = []
  • ip = ""
  • exitNode = ""
  • binaryAvailable = false

The logic is duplicated instead of being extracted to a single helper.

Impact

Minor maintainability issue. Any future change to the reset behavior must be made in two places.

## Problem Both the `catch` block (JSON parse failure) and the `onExited(code !== 0)` handler in `statusCheck` perform the same four property resets: - `peers = []` - `ip = ""` - `exitNode = ""` - `binaryAvailable = false` The logic is duplicated instead of being extracted to a single helper. ## Impact Minor maintainability issue. Any future change to the reset behavior must be made in two places.
Author
Collaborator

Removed duplicate state-reset logic; single reset in onExited. Merged to vibes.

Removed duplicate state-reset logic; single reset in onExited. Merged to vibes.
Author
Collaborator

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

Resolved via merge daab237. The plugin is confirmed working by @jtmorris. Human code review required before merging to testing.
vybe closed this issue 2026-05-21 07:16:59 +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#31
No description provided.