Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/devtools_app/lib/src/service_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class ServiceConnectionManager {
serviceStreamName,
];

await Future.wait(streamIds.map((String id) async {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the Future.wait as well. it isn't doing anything useful now that the result is unawaited.
This change could cause some tricky race conditions.
Main race condition: need to ensure that we are listening for isolate events before we fetch the isolate. Otherwise we could incorrectly believe the isolate is paused because we missed the resume event.
@bkonyi I know a lot of the streams now have history. If all the streams where race conditions matter are ones where we can fetch with history then we are safe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting! Unless I'm misunderstanding something, it looks like currently we are fetching the isolate before listening for the isolate events. (await isolateManager.init(isolates) is the call right before this call to start listening to the streams). Might make sense to send off the stream listen requests earlier.

unawaited(Future.wait(streamIds.map((String id) async {
try {
await service.streamListen(id);
} catch (e) {
Expand All @@ -287,7 +287,7 @@ class ServiceConnectionManager {
);
}
}
}));
})));
if (service != this.service) {
// A different service has been opened.
return;
Expand Down