Bug Description
After hot restart, the Network tab stops capturing HTTP requests entirely. Requests visible before hot restart disappear and new ones are never shown. This is a P2 regression affecting all Flutter developers using DevTools Network profiling.
First reported: #9783
Root Cause (Code Analysis)
In network_controller.dart, _initHelper() calls startRecording() once on initial connection:
void _initHelper() async {
// ...
if (serviceConnection.serviceManager.connectedState.value.connected) {
await startRecording(); // ← called once, never again
}
}
startRecording() ultimately calls:
await http_service.toggleHttpRequestLogging(true); // enables on current isolates
await networkService.toggleSocketProfiling(true); // enables on current isolates
The problem: Both calls use service.forEachIsolate(...) at the time of invocation. When a hot restart occurs, the Dart VM disposes all existing isolates and creates a new root isolate. The new isolate is never registered with toggleHttpRequestLogging(true), so HTTP profiling is disabled on it — and the Network tab never receives new requests.
network_service.dart's _refreshHttpProfile() also tracks per-isolate refresh times in lastHttpDataRefreshTimePerIsolate, but new isolates start with updatedSince: 0 — they should receive all requests — yet nothing shows up because HTTP logging is simply not enabled on the new isolate.
Expected Behavior
After hot restart, the Network tab should continue capturing HTTP requests from the newly spawned isolate.
Actual Behavior
Network tab freezes / stops capturing. No new requests appear after hot restart.
Fix
Listen to serviceConnection.serviceManager.isolateManager.onIsolateCreated in NetworkController.init() and re-enable HTTP logging + socket profiling for new isolates:
@override
void init() {
super.init();
_initHelper();
addAutoDisposeListener(
_currentNetworkRequests,
_filterAndRefreshSearchMatches,
);
// Re-enable HTTP logging on new isolates (e.g. after hot restart)
autoDisposeStreamSubscription(
serviceConnection
.serviceManager
.isolateManager
.onIsolateCreated
.listen((_) async {
if (_recordingNotifier.value) {
await http_service.toggleHttpRequestLogging(true);
await networkService.toggleSocketProfiling(true);
}
}),
);
}
This ensures HTTP profiling is re-enabled every time a new isolate is spawned, covering hot restart, hot reload edge cases, and add-to-app scenarios.
Environment
Affects all DevTools versions where Network recording is present. Confirmed on DevTools 2.54.2.
Flutter 3.41.7 • channel stable
DevTools 2.54.2
PR
Fix is ready — see linked PR.
Bug Description
After hot restart, the Network tab stops capturing HTTP requests entirely. Requests visible before hot restart disappear and new ones are never shown. This is a P2 regression affecting all Flutter developers using DevTools Network profiling.
First reported: #9783
Root Cause (Code Analysis)
In
network_controller.dart,_initHelper()callsstartRecording()once on initial connection:startRecording()ultimately calls:The problem: Both calls use
service.forEachIsolate(...)at the time of invocation. When a hot restart occurs, the Dart VM disposes all existing isolates and creates a new root isolate. The new isolate is never registered withtoggleHttpRequestLogging(true), so HTTP profiling is disabled on it — and the Network tab never receives new requests.network_service.dart's_refreshHttpProfile()also tracks per-isolate refresh times inlastHttpDataRefreshTimePerIsolate, but new isolates start withupdatedSince: 0— they should receive all requests — yet nothing shows up because HTTP logging is simply not enabled on the new isolate.Expected Behavior
After hot restart, the Network tab should continue capturing HTTP requests from the newly spawned isolate.
Actual Behavior
Network tab freezes / stops capturing. No new requests appear after hot restart.
Fix
Listen to
serviceConnection.serviceManager.isolateManager.onIsolateCreatedinNetworkController.init()and re-enable HTTP logging + socket profiling for new isolates:This ensures HTTP profiling is re-enabled every time a new isolate is spawned, covering hot restart, hot reload edge cases, and add-to-app scenarios.
Environment
Affects all DevTools versions where Network recording is present. Confirmed on DevTools 2.54.2.
PR
Fix is ready — see linked PR.