From c7574be4a330cad5886ae242aec3b9a92d8946e3 Mon Sep 17 00:00:00 2001 From: Andrew Kolos Date: Tue, 14 May 2024 12:34:04 -0700 Subject: [PATCH] add another print trace to runInView (#148337) In service of https://github.com/flutter/flutter/issues/146879. See https://github.com/flutter/flutter/issues/146879#issuecomment-2110781156. I wonder if something is going wrong in the process of subscribing to the isolate event stream in the VM service. This adds a print trace to the `catch` clause of this subscription call. --- packages/flutter_tools/lib/src/vmservice.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index edcada46a5..cb118ce5e4 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -574,7 +574,11 @@ class FlutterVmService { _logger.printTrace('Running $main in view $viewId...'); try { await service.streamListen(vm_service.EventStreams.kIsolate); - } on vm_service.RPCError { + } on vm_service.RPCError catch (e) { + _logger.printTrace( + 'Unable to listen to VM service stream "${vm_service.EventStreams.kIsolate}".\n' + 'Error: $e', + ); // Do nothing, since the tool is already subscribed. } final Future onRunnable = service.onIsolateEvent.firstWhere((vm_service.Event event) { @@ -911,11 +915,9 @@ class FlutterVmService { Duration delay = const Duration(milliseconds: 50), }) async { while (true) { - _logger.printTrace('Calling _flutter.listViews...'); final vm_service.Response? response = await callMethodWrapper( kListViewsMethod, ); - _logger.printTrace('Response from _flutter.listViews: ${json.encode(response?.json)}'); if (response == null) { // The service may have disappeared mid-request. // Return an empty list now, and let the shutdown logic elsewhere deal