@@ -8,7 +8,6 @@ import 'package:vm_service/vm_service.dart' as vm_service;
8
8
import 'package:meta/meta.dart' ;
9
9
import 'package:pool/pool.dart' ;
10
10
11
- import 'base/async_guard.dart' ;
12
11
import 'base/context.dart' ;
13
12
import 'base/file_system.dart' ;
14
13
import 'base/logger.dart' ;
@@ -105,6 +104,7 @@ class HotRunner extends ResidentRunner {
105
104
/// reload process do not have this issue.
106
105
bool _swap = false ;
107
106
107
+ /// Whether the resident runner has correctly attached to the running application.
108
108
bool _didAttach = false ;
109
109
110
110
final Map <String , List <int >> benchmarkData = < String , List <int >> {};
@@ -121,7 +121,6 @@ class HotRunner extends ResidentRunner {
121
121
bool force = false ,
122
122
bool pause = false ,
123
123
}) async {
124
- // TODO(cbernaschina): check that isolateId is the id of the UI isolate.
125
124
final OperationResult result = await restart (pause: pause);
126
125
if (! result.isOk) {
127
126
throw vm_service.RPCError (
@@ -469,8 +468,6 @@ class HotRunner extends ResidentRunner {
469
468
String reason,
470
469
}) async {
471
470
final Stopwatch restartTimer = Stopwatch ()..start ();
472
- // TODO(aam): Add generator reset logic once we switch to using incremental
473
- // compiler for full application recompilation on restart.
474
471
final UpdateFSReport updatedDevFS = await _updateDevFS (fullRestart: true );
475
472
if (! updatedDevFS.success) {
476
473
for (final FlutterDevice device in flutterDevices) {
@@ -592,6 +589,9 @@ class HotRunner extends ResidentRunner {
592
589
bool silent = false ,
593
590
bool pause = false ,
594
591
}) async {
592
+ if (flutterDevices.any ((FlutterDevice device) => device.devFS == null )) {
593
+ return OperationResult (1 , 'Device initialization has not completed.' );
594
+ }
595
595
String targetPlatform;
596
596
String sdkName;
597
597
bool emulator;
@@ -666,13 +666,7 @@ class HotRunner extends ResidentRunner {
666
666
if (! (await hotRunnerConfig.setupHotRestart ())) {
667
667
return OperationResult (1 , 'setupHotRestart failed' );
668
668
}
669
- // The current implementation of the vmservice and JSON rpc may throw
670
- // unhandled exceptions into the zone that cannot be caught with a regular
671
- // try catch. The usage is [asyncGuard] is required to normalize the error
672
- // handling, at least until we can refactor the underlying code.
673
- result = await asyncGuard (() => _restartFromSources (
674
- reason: reason,
675
- ));
669
+ result = await _restartFromSources (reason: reason,);
676
670
if (! result.isOk) {
677
671
restartEvent = 'restart-failed' ;
678
672
}
0 commit comments