fix: Context parse error, parent should be ContextRef
Bug: https://github.com/dart-lang/sdk/issues/45083
TEST=N/A
Change-Id: I1781c83ac2e8868f1d6a49fc4a01edd3e3eef460
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192880
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md
index 5f0da4d..47f3893 100644
--- a/pkg/vm_service/CHANGELOG.md
+++ b/pkg/vm_service/CHANGELOG.md
@@ -1,6 +1,6 @@
# Changelog
-
-## 6.3.0-dev
+## 7.0.0
+- *breaking bug fix*: Fixed issue where response parsing could fail for `Context`.
- Add support for `setBreakpointState` RPC and updated `Breakpoint` class to include
`enabled` property.
diff --git a/pkg/vm_service/lib/src/vm_service.dart b/pkg/vm_service/lib/src/vm_service.dart
index 50fe029..a42219a 100644
--- a/pkg/vm_service/lib/src/vm_service.dart
+++ b/pkg/vm_service/lib/src/vm_service.dart
@@ -3318,7 +3318,7 @@
/// The enclosing context for this context.
@optional
- Context? parent;
+ ContextRef? parent;
/// The variables in this context object.
List<ContextElement>? variables;
@@ -3334,7 +3334,8 @@
Context._fromJson(Map<String, dynamic> json) : super._fromJson(json) {
length = json['length'] ?? -1;
- parent = createServiceObject(json['parent'], const ['Context']) as Context?;
+ parent = createServiceObject(json['parent'], const ['ContextRef'])
+ as ContextRef?;
variables = List<ContextElement>.from(
createServiceObject(json['variables'], const ['ContextElement'])
as List? ??
diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml
index dfe2e30..a7db2e8 100644
--- a/pkg/vm_service/pubspec.yaml
+++ b/pkg/vm_service/pubspec.yaml
@@ -3,7 +3,7 @@
A library to communicate with a service implementing the Dart VM
service protocol.
-version: 6.3.0-dev
+version: 7.0.0
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/vm_service
diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md
index 99bdab7..3000c42 100644
--- a/runtime/vm/service/service.md
+++ b/runtime/vm/service/service.md
@@ -1832,7 +1832,7 @@
int length;
// The enclosing context for this context.
- Context parent [optional];
+ @Context parent [optional];
// The variables in this context object.
ContextElement[] variables;