[CP] [dds/dap] Treat "Service Connection Disposed" the same as "Client closed with pending request"
Should fix https://github.com/flutter/flutter/issues/153473
Change-Id: I77bcf2da01d340412c3dc709a74cc8ed2d80a43f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381181
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Helin Shiah <helinx@google.com>
diff --git a/pkg/dds/CHANGELOG.md b/pkg/dds/CHANGELOG.md
index a515f93..72cd187 100644
--- a/pkg/dds/CHANGELOG.md
+++ b/pkg/dds/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 4.2.4+2
+- [DAP] Fixed an issue where "Service connection disposed" errors may go unhandled during termination/shutdown.Uint8List` from `dart:typed_data`.
+- Added `package:dds/dds_launcher.dart`, a library which can be used to launch DDS instances using `dart development-service`.
+
 # 4.2.4+1
 - Added missing type to `Event` in `postEvent`.
 - [DAP] Instaces with both fields and getters of the same name will no longer show duplicates in `variables` responses.
@@ -310,8 +314,8 @@
 # 1.7.0
 - Added `package:dds/vm_service_extensions.dart`, which adds DDS functionality to
   `package:vm_service` when imported.
-  - Added `onEventWithHistory` method and `onLoggingEventWithHistory`, 
-    `onStdoutEventWithHistory`, `onStderrEventWithHistory`, and 
+  - Added `onEventWithHistory` method and `onLoggingEventWithHistory`,
+    `onStdoutEventWithHistory`, `onStderrEventWithHistory`, and
     `onExtensionEventWithHistory` getters.
 - Added `getStreamHistory` RPC.
 
diff --git a/pkg/dds/lib/src/dap/adapters/dart.dart b/pkg/dds/lib/src/dap/adapters/dart.dart
index 51228f2..1a0a1f62 100644
--- a/pkg/dds/lib/src/dap/adapters/dart.dart
+++ b/pkg/dds/lib/src/dap/adapters/dart.dart
@@ -2845,7 +2845,8 @@
         // errors because these can always occur during shutdown if we were
         // just starting to send (or had just sent) a request.
         if (e.message.contains("The client is closed") ||
-            e.message.contains("The client closed with pending request")) {
+            e.message.contains("The client closed with pending request") ||
+            e.message.contains("Service connection disposed")) {
           return null;
         }
       }
diff --git a/pkg/dds/pubspec.yaml b/pkg/dds/pubspec.yaml
index c159257..e136322 100644
--- a/pkg/dds/pubspec.yaml
+++ b/pkg/dds/pubspec.yaml
@@ -1,5 +1,5 @@
 name: dds
-version: 4.2.4+1
+version: 4.2.4+2
 description: >-
   A library used to spawn the Dart Developer Service, used to communicate with
   a Dart VM Service instance.