Skip to content

Conversation

@elliette
Copy link
Member

@elliette elliette commented Jan 29, 2026

Fixes #9632

DTDManager now subscribes to the Service stream, and broadcasts ServiceRegistered and ServiceUnregistered events to any subscribers.

Currently the EditorClient is the only subscriber, but our AI Assistant will also need to subscribe to those events.

FYI @DanTup I've changed the DTD reconnection logic a little bit. I tested the Flutter panel and Property Editor in VS Code, but you might want to verify as well.

Comment on lines +260 to 263
if (_connection.value case final connection?) {
await connection.close();
}
_connection.value = null;
Copy link
Member Author

Choose a reason for hiding this comment

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

I noticed that we were setting the connection to null without closing it first

_connection.value = connection;
// Close the previous connection.
if (previousConnection != null) {
await previousConnection.close();
Copy link
Member Author

Choose a reason for hiding this comment

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

Before this change, we were closing the connection during the disconnect implementation. I moved it here to the connect implementation instead so that we wait for the new connection before closing the previous connection (this prevents us from dropping any service extension registration events we receive while reconnecting).

@elliette elliette marked this pull request as ready for review January 30, 2026 23:11
@elliette elliette requested review from a team and kenzieschmoll as code owners January 30, 2026 23:11
@elliette elliette requested review from a team, DanTup, bkonyi and srawlins and removed request for a team, bkonyi and kenzieschmoll January 30, 2026 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AI Assistance] Shared DTD service extension manager

1 participant