@@ -192,10 +192,6 @@ final class WebSocketProxyService extends ProxyService<WebSocketAppInspector> {
192192 return service;
193193 }
194194
195- // Isolate state
196- vm_service.Event ? _currentPauseEvent;
197- bool _mainHasStarted = false ;
198-
199195 /// Creates a new isolate for WebSocket debugging.
200196 @override
201197 Future <void > createIsolate (
@@ -276,7 +272,7 @@ final class WebSocketProxyService extends ProxyService<WebSocketAppInspector> {
276272 timestamp: timestamp,
277273 isolate: isolateRef,
278274 );
279- _currentPauseEvent = pauseEvent;
275+ inspector.isolate.pauseEvent = pauseEvent;
280276 streamNotify (vm_service.EventStreams .kDebug, pauseEvent);
281277 }
282278
@@ -383,8 +379,6 @@ final class WebSocketProxyService extends ProxyService<WebSocketAppInspector> {
383379
384380 // Reset state
385381 inspector = null ;
386- _currentPauseEvent = null ;
387- _mainHasStarted = false ;
388382
389383 if (initializedCompleter.isCompleted) {
390384 initializedCompleter = Completer <void >();
@@ -784,13 +778,13 @@ final class WebSocketProxyService extends ProxyService<WebSocketAppInspector> {
784778 value == 'true' &&
785779 oldValue == false ) {
786780 // Send pause event for existing isolate if not already paused
787- if (isIsolateRunning && _currentPauseEvent == null ) {
781+ if (isIsolateRunning && inspector.isolate.pauseEvent == null ) {
788782 final pauseEvent = vm_service.Event (
789783 kind: vm_service.EventKind .kPauseStart,
790784 timestamp: DateTime .now ().millisecondsSinceEpoch,
791785 isolate: inspector.isolateRef,
792786 );
793- _currentPauseEvent = pauseEvent;
787+ inspector.isolate.pauseEvent = pauseEvent;
794788 streamNotify (vm_service.EventStreams .kDebug, pauseEvent);
795789 }
796790 }
@@ -812,24 +806,13 @@ final class WebSocketProxyService extends ProxyService<WebSocketAppInspector> {
812806 Future <Success > _resume (String isolateId) async {
813807 if (hasPendingRestart && ! resumeAfterRestartEventsController.isClosed) {
814808 resumeAfterRestartEventsController.add (isolateId);
815- } else {
816- if (! _mainHasStarted) {
817- try {
818- appConnection.runMain ();
819- _mainHasStarted = true ;
820- } catch (e) {
821- if (e.toString ().contains ('Main has already started' )) {
822- _mainHasStarted = true ;
823- } else {
824- rethrow ;
825- }
826- }
827- }
809+ } else if (! appConnection.hasStarted) {
810+ appConnection.runMain ();
828811 }
829812
830813 // Clear pause state and send resume event to notify debugging tools
831- if (_currentPauseEvent != null ) {
832- _currentPauseEvent = null ;
814+ if (inspector.isolate.pauseEvent != null ) {
815+ inspector.isolate.pauseEvent = null ;
833816 final resumeEvent = vm_service.Event (
834817 kind: vm_service.EventKind .kResume,
835818 timestamp: DateTime .now ().millisecondsSinceEpoch,
0 commit comments