Skip to content

Add DISCONNECT structure event for app connection loss#26

Merged
stefanrammo merged 1 commit intomainfrom
add-disconnect-structure-event
Apr 8, 2026
Merged

Add DISCONNECT structure event for app connection loss#26
stefanrammo merged 1 commit intomainfrom
add-disconnect-structure-event

Conversation

@stefanrammo
Copy link
Copy Markdown
Collaborator

Adds DISCONNECT (3) to studio.api.structure to distinguish app going offline from child node removal (REMOVE):

  • DISCONNECT (3) fires at root level when an app goes offline
  • REMOVE (0) fires at node level when a child is removed
  • RECONNECT (2) fires at root level when a disconnected app returns

Also populates connectionLocalApps for the primary connection in proxy mode. Previously it was only populated in direct mode, so the primary app never fired DISCONNECT or RECONNECT when its connection dropped in proxy mode.

CDP-6069

Adds DISCONNECT (3) to studio.api.structure to distinguish app going
offline from child node removal (REMOVE):

- DISCONNECT (3) fires at root level when an app goes offline
- REMOVE (0) fires at node level when a child is removed
- RECONNECT (2) fires at root level when a disconnected app returns

Also populates connectionLocalApps for the primary connection in
proxy mode. Previously it was only populated in direct mode, so
the primary app never fired DISCONNECT or RECONNECT when its
connection dropped in proxy mode.

CDP-6069
@stefanrammo stefanrammo requested review from Karmo7 and nuubik April 7, 2026 14:01
(e.g. components or operators added to a running application):

- ``studio.api.structure.ADD`` (1) — A child node was added
- ``studio.api.structure.REMOVE`` (0) — A child node was removed
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you called subscribeToStructure on a deeped node (not root node) then shouldn't those nodes also report DISCONNECT and RECONNECT? I mean add/remove should refer to when something in CDP node tree actually changes, e.g. a CDPOperator is added/removed from a component.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REMOVE now only fires for tree node changes, not app lifecycle. DISCONNECT and RECONNECT currently only fire when subscribed on the system node, not on individual app nodes. I could do a follow up to add it for deeper nodes.

@stefanrammo stefanrammo merged commit c813745 into main Apr 8, 2026
4 checks passed
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.

3 participants