devtools
e18fd8ef - Fix ParallelWaitError in forEachIsolateHelper during service disconnect (#10074)

Commit
25 days ago
Fix ParallelWaitError in forEachIsolateHelper during service disconnect (#10074) `forEachIsolateHelper` used `[for (final isolate in vmIsolates) callback(isolate)].wait`. In Dart 3, the `Iterable.wait` extension wraps any error from completed futures in a `ParallelWaitError<V, E>`. When a target application exits or a VM Service connection is shut down while an operation is in flight (e.g. periodic polling in `refreshNetworkData`), VM Service methods like `getSocketProfileWrapper` throw `RPCError: (112) Service has disappeared`. Callers catch typed errors (e.g., `on RPCError catch (e)` in `network_service.dart` or `on SentinelException` / `on RPCError` in `service_extension_manager.dart`) and check `e.isServiceDisposedError` to safely swallow teardown exceptions. Because `ParallelWaitError` does not inherit from `RPCError` or `Exception`, it bypassed these typed catch blocks and escaped uncaught, causing flaky integration test failures in `network_screen_test.dart`. Using `Future.wait` preserves the underlying exception type thrown by the isolate callback. Also update `_enableNetworkTrafficRecordingOnAllIsolates` to use `Future.wait`.
Author
Parents
Loading