From 315471bfb0d9accb026e8e138e26b2b4c9a632ba Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 17 Oct 2019 16:56:57 -0700 Subject: [PATCH] Do not produce an error when encountering a new type in a service response. (#42972) Flutter tool's service client library tries to "upgrade" sub-components of service responses with higher level model objects. It does this for all members of the response, rather than only those documented in the version it targets, and it errors out when encountering a new type. This causes it to fail when a new field is introduced with a new typed. Clients are required to ignore this. --- packages/flutter_tools/lib/src/vmservice.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index fbf6e6bb31..dae77dace1 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -840,8 +840,12 @@ class VM extends ServiceObjectOwner { } return view; default: - throw VMServiceObjectLoadError( - 'VM.getFromMap called for something other than an isolate', map); + // If we don't have a model object for this service object type, as a + // fallback return a ServiceMap object. + final ServiceObject serviceObject = ServiceMap._empty(owner); + // We have now constructed an empty service object, call update to populate it. + serviceObject.updateFromMap(map); + return serviceObject; } }