Skip to content

fix(debug): align web/app debug status fields between service and UI#209

Open
Asuka22687 wants to merge 1 commit intoreisxd:mainfrom
Asuka22687:fix/debug-status-field-alignment
Open

fix(debug): align web/app debug status fields between service and UI#209
Asuka22687 wants to merge 1 commit intoreisxd:mainfrom
Asuka22687:fix/debug-status-field-alignment

Conversation

@Asuka22687
Copy link

Summary

This PR aligns debug status field naming between backend service and UI to prevent incorrect state branching.

Problem

Service state uses webDebug, while parts of the UI logic read appDebug.

Because of this mismatch, debug-state checks can evaluate incorrectly and launch flow may enter wrong branches.

Root Cause

Field naming diverged over time across:

  • service state payload
  • client initial state
  • websocket event handling

Changes

Service-side compatibility

  • Added appDebug alongside webDebug in the service debug state object.
  • Kept both fields synchronized during state transitions (connect/disconnect and app launch reset).

UI-side normalization

  • Added webDebug to initial context state.
  • Normalized incoming debug payload in websocket client:
    • derives both webDebug and appDebug from incoming payload (webDebug || appDebug)
  • Updated gating checks to use normalized webDebug path.
  • Ensured handleCanLaunchModules updates both fields for compatibility.

Backward Compatibility

Maintains compatibility for both payload shapes:

  • old clients expecting appDebug
  • current service shape with webDebug

Validation

  • Static syntax checks:
    • node --check service index.js
    • node --check service utils/debugger.js
    • node --check UI WebSocketClient.js

Risk

Low to medium. Multi-file change but constrained to debug status mapping/state sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant