Version 2.12.0-237.0.dev
Merge commit '6de68d541ab3c5ccdda58539266283b2077461fc' into 'dev'
diff --git a/pkg/dds/CHANGELOG.md b/pkg/dds/CHANGELOG.md
index 80420e2..13e8fca 100644
--- a/pkg/dds/CHANGELOG.md
+++ b/pkg/dds/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 1.7.2
+- Fixed issue where a null JSON RPC result could be sent if the VM service
+ disconnected with a request in flight (see https://github.com/flutter/flutter/issues/74051).
+
# 1.7.1
- Fixed issue where DartDevelopmentServiceException could have a null message.
diff --git a/pkg/dds/lib/src/client.dart b/pkg/dds/lib/src/client.dart
index f8018f9..7b64867 100644
--- a/pkg/dds/lib/src/client.dart
+++ b/pkg/dds/lib/src/client.dart
@@ -266,12 +266,14 @@
// Unless otherwise specified, the request is forwarded to the VM service.
// NOTE: This must be the last fallback registered.
_clientPeer.registerFallback((parameters) async {
- try {
- return await _vmServicePeer.sendRequest(
- parameters.method, parameters.value);
- } on StateError {
- await dds.shutdown();
- }
+ // If _vmServicePeer closes in the middle of a request, this will throw
+ // a StateError that will be forwarded to the requesting client.
+ // Listeners in dds_impl.dart will handle shutting down the DDS, so
+ // we don't try and handle the error here.
+ return await _vmServicePeer.sendRequest(
+ parameters.method,
+ parameters.value,
+ );
});
}
diff --git a/pkg/dds/pubspec.yaml b/pkg/dds/pubspec.yaml
index a7fff90..6e69aa5 100644
--- a/pkg/dds/pubspec.yaml
+++ b/pkg/dds/pubspec.yaml
@@ -3,7 +3,7 @@
A library used to spawn the Dart Developer Service, used to communicate with
a Dart VM Service instance.
-version: 1.7.1
+version: 1.7.2
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/dds
diff --git a/pkg/dds/test/handles_client_disconnect_state_error_test.dart b/pkg/dds/test/handles_client_disconnect_state_error_test.dart
index 0b93db4..7499a52 100644
--- a/pkg/dds/test/handles_client_disconnect_state_error_test.dart
+++ b/pkg/dds/test/handles_client_disconnect_state_error_test.dart
@@ -29,6 +29,9 @@
completer.completeError(
StateError('The client closed with pending request "foo".'),
);
+ doneCompleter.completeError(
+ StateError('The client closed with pending request "foo".'),
+ );
break;
default:
completer.complete(await super.sendRequest(method, args));
@@ -83,8 +86,8 @@
// unexpectedly.
try {
await client.sendRequest('foo');
- } on StateError {
- // This state error is expected. This test is ensuring that DDS exits
+ } on json_rpc.RpcException {
+ // This RPC exception is expected. This test is ensuring that DDS exits
// gracefully even if the VM service disappears.
}
diff --git a/tools/VERSION b/tools/VERSION
index 235cc3e..71faf2a 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 12
PATCH 0
-PRERELEASE 236
+PRERELEASE 237
PRERELEASE_PATCH 0
\ No newline at end of file