File tree Expand file tree Collapse file tree
standalone_ui/ide_shared/property_editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -317,25 +317,8 @@ class EditorClient extends DisposableController
317317 }
318318 }
319319
320- Future <bool > isClientClosed () async {
321- try {
322- // Make an empty request to DTD.
323- await _dtd.call ('' , '' );
324- } on StateError catch (e) {
325- // TODO(https://github.com/flutter/devtools/issues/9028): Replace with a
326- // check for whether DTD is closed. Requires a change to package:dtd.
327- //
328- // This is only a temporary fix. If the error in package:json_rpc_2 is
329- // changed, this will no longer catch it. See:
330- // https://github.com/dart-lang/tools/blob/b55643dadafd3ac6b2bd20823802f75929ebf98e/pkgs/json_rpc_2/lib/src/client.dart#L151
331- if (e.message.contains ('The client is closed.' )) {
332- return true ;
333- }
334- } catch (e) {
335- // Ignore other exceptions. If the client is open, we expect this to fail
336- // with the error: 'Unknown method "."'.
337- }
338- return false ;
320+ bool isClientClosed () {
321+ return _dtd.isClosed;
339322 }
340323
341324 Future <DTDResponse > _call (
Original file line number Diff line number Diff line change @@ -175,8 +175,8 @@ class PropertyEditorController extends DisposableController
175175 }
176176
177177 Timer _periodicallyCheckConnection (Duration interval) {
178- return Timer .periodic (interval, (timer) async {
179- final isClosed = await editorClient.isClientClosed ();
178+ return Timer .periodic (interval, (timer) {
179+ final isClosed = editorClient.isClientClosed ();
180180 if (isClosed) {
181181 _shouldReconnect.value = true ;
182182 timer.cancel ();
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ dependencies:
2525 devtools_app_shared :
2626 devtools_extensions :
2727 devtools_shared :
28- dtd : ^2.4 .0
28+ dtd : ^2.5 .0
2929 file : ^7.0.0
3030 file_selector : ^1.0.0
3131 fixnum : ^1.1.0
You can’t perform that action at this time.
0 commit comments