From a8504405a8dcad08653fc01c2ccd1fe19d0970d7 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 30 Apr 2019 23:27:30 -0700 Subject: [PATCH] Revert "Handle notification errors (#31868)" (#31886) This reverts commit c0d5fd23ab85152575cd32190008d257bb11a3d4. --- packages/flutter_driver/lib/src/driver/driver.dart | 13 ++----------- packages/flutter_tools/lib/src/vmservice.dart | 10 ---------- .../lib/src/dart/dart_vm.dart | 8 -------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/packages/flutter_driver/lib/src/driver/driver.dart b/packages/flutter_driver/lib/src/driver/driver.dart index 83458c33563..8929118dcc1 100644 --- a/packages/flutter_driver/lib/src/driver/driver.dart +++ b/packages/flutter_driver/lib/src/driver/driver.dart @@ -934,18 +934,9 @@ void restoreVmServiceConnectFunction() { } void _unhandledJsonRpcError(dynamic error, dynamic stack) { - if (error is rpc.RpcException) { - final rpc.RpcException rpcException = error; - if (rpcException.data != null && rpcException.data['id'] == null) { - // This can happen, e.g., if a client tries to call us before methods have - // been registered, but the client doesn't care for a response. - _log.trace('RPC client sent a notification that resulted in an error:\n$error'); - return; - } - assert(false, 'json_rpc_2 failed to send an exception back to the client.'); - } _log.trace('Unhandled RPC error:\n$error\n$stack'); - assert(false); + // TODO(dnfield): https://github.com/flutter/flutter/issues/31813 + // assert(false); } /// Waits for a real Dart VM service to become available, then connects using diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index c21f76ce606..4290f6b9788 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -237,16 +237,6 @@ class VMService { } static void _unhandledError(dynamic error, dynamic stack) { - if (error is rpc.RpcException) { - final rpc.RpcException rpcException = error; - if (rpcException.data != null && rpcException.data['id'] == null) { - // This can happen, e.g., if a client tries to call us before methods have - // been registered, but the client doesn't care for a response. - logger.printTrace('RPC client sent a notification that resulted in an error:\n$error'); - return; - } - assert(false, 'json_rpc_2 failed to send an exception back to the client.'); - } logger.printTrace('Error in internal implementation of JSON RPC.\n$error\n$stack'); assert(false); } diff --git a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart index 98cdb4fd6bb..410d6f8251e 100644 --- a/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart +++ b/packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart @@ -33,14 +33,6 @@ RpcPeerConnectionFunction fuchsiaVmServiceConnectionFunction = _waitAndConnect; void _unhandledJsonRpcError(dynamic error, dynamic stack) { - if (error is json_rpc.RpcException) { - final json_rpc.RpcException rpcException = error; - if (rpcException.data != null && rpcException.data['id'] == null) { - // This can happen, e.g., if a client tries to call us before methods have - // been registered, but the client doesn't care for a response. - return; - } - } _log.fine('Error in internalimplementation of JSON RPC.\n$error\n$stack'); }