Skip to content

Commit

Permalink
Widget inspector should operate on main isolate, not selected isolate (
Browse files Browse the repository at this point in the history
  • Loading branch information
CoderDake committed Sep 25, 2023
1 parent 6af5dde commit 54bb6fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -35,13 +35,15 @@ abstract class InspectorServiceBase extends DisposableController
required this.clientInspectorName,
required this.serviceExtensionPrefix,
required String inspectorLibraryUri,
ValueListenable<IsolateRef?>? evalIsolate,
}) : assert(serviceConnection.serviceManager.connectedAppInitialized),
assert(serviceConnection.serviceManager.service != null),
clients = {},
inspectorLibrary = EvalOnDartLibrary(
inspectorLibraryUri,
serviceConnection.serviceManager.service!,
serviceManager: serviceConnection.serviceManager,
isolate: evalIsolate,
) {
_lastMainIsolate =
serviceConnection.serviceManager.isolateManager.mainIsolate.value;
Expand Down Expand Up @@ -194,6 +196,8 @@ class InspectorService extends InspectorServiceBase {
clientInspectorName: 'WidgetInspectorService',
serviceExtensionPrefix: inspectorExtensionPrefix,
inspectorLibraryUri: inspectorLibraryUri,
evalIsolate:
serviceConnection.serviceManager.isolateManager.mainIsolate,
) {
// Note: We do not need to listen to event history here because the
// inspector uses a separate API to get the current inspector selection.
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Expand Up @@ -27,7 +27,7 @@ DevTools extension for your pub package, see the getting started guide for

## Inspector updates

TODO: Remove this section if there are not any general updates.
* Fixed bug where inspector service calls were done on the selected isolate, instead of the main isolate - [#6434](https://github.com/flutter/devtools/pull/6434)

## Performance updates

Expand Down

0 comments on commit 54bb6fa

Please sign in to comment.