Do not cancel the VmService's subscription to the isolate event stream in FlutterVmService.findExtensionIsolate (#153607)
The stream subscriptions in the device's VmService are used by other parts of FlutterVmService and other components throughout flutter_tools. Components that listen to streams should not call VmService.streamCancel because that will interfere with other users who still want the events. See https://github.com/flutter/flutter/issues/153049 See https://github.com/flutter/flutter/issues/153563
This commit is contained in:
parent
bf5bcff0c2
commit
31c3d0927b
@ -986,11 +986,6 @@ class FlutterVmService {
|
||||
throw VmServiceDisappearedException();
|
||||
} finally {
|
||||
await isolateEvents.cancel();
|
||||
try {
|
||||
await service.streamCancel(vm_service.EventStreams.kIsolate);
|
||||
} on vm_service.RPCError {
|
||||
// It's ok for cleanup to fail, such as when the service disappears.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,12 +96,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamListen',
|
||||
args: <String, Object>{
|
||||
|
@ -153,12 +153,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
@ -224,12 +218,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'ext.flutter.activeDevToolsServerAddress',
|
||||
args: <String, Object>{
|
||||
@ -270,13 +258,6 @@ void main() {
|
||||
method: kListViewsMethod,
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
], httpAddress: Uri.parse('http://localhost:1234'));
|
||||
|
||||
final FakeFlutterDevice device = FakeFlutterDevice()
|
||||
@ -311,12 +292,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
listViews,
|
||||
listViews,
|
||||
const FakeVmServiceRequest(
|
||||
@ -346,13 +321,6 @@ void main() {
|
||||
method: kListViewsMethod,
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
], httpAddress: Uri.parse('http://localhost:5678'));
|
||||
|
||||
await handler.serveAndAnnounceDevTools(
|
||||
|
@ -535,12 +535,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
final vm_service.IsolateRef isolateRef = await fakeVmServiceHost.vmService.findExtensionIsolate(kExtensionName);
|
||||
@ -592,12 +586,6 @@ void main() {
|
||||
'isolateId': '2',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
final vm_service.IsolateRef isolateRef = await fakeVmServiceHost.vmService.findExtensionIsolate(otherExtensionName);
|
||||
@ -644,12 +632,6 @@ void main() {
|
||||
isolate: isolate2,
|
||||
),
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
final vm_service.IsolateRef isolateRef = await fakeVmServiceHost.vmService.findExtensionIsolate(otherExtensionName);
|
||||
@ -674,12 +656,6 @@ void main() {
|
||||
'isolateId': '1',
|
||||
},
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
final vm_service.IsolateRef isolateRef = await fakeVmServiceHost.vmService.findExtensionIsolate(kExtensionName);
|
||||
@ -710,12 +686,6 @@ void main() {
|
||||
timestamp: 1,
|
||||
),
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
),
|
||||
]);
|
||||
|
||||
final vm_service.IsolateRef isolateRef = await fakeVmServiceHost.vmService.findExtensionIsolate(kExtensionName);
|
||||
@ -734,13 +704,6 @@ void main() {
|
||||
method: kListViewsMethod,
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
const FakeVmServiceRequest(
|
||||
method: 'streamCancel',
|
||||
args: <String, Object>{
|
||||
'streamId': 'Isolate',
|
||||
},
|
||||
error: FakeRPCError(code: RPCErrorCodes.kServiceDisappeared),
|
||||
),
|
||||
]);
|
||||
|
||||
expect(
|
||||
|
@ -81,7 +81,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('hot restart works without error', () async {
|
||||
await flutter.run(verbose: true, noDevtools: true);
|
||||
await flutter.run(verbose: true);
|
||||
await flutter.hotRestart();
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user