-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
#154903 documented a common tool crash in 3.24.2, where FlutterDevice.initLogReader will throw an RPCError if the HotRunner was unable to communicate with the VM (which can happen for a variety of reasons; e.g. the device is shutdown/disconnected).
#155049 adjusted this code to catch this error, discard it, and log a warning. However, the warning is vague and not useful for users:
flutter/packages/flutter_tools/lib/src/resident_runner.dart
Lines 422 to 434 in d8f8613
| Future<void> tryInitLogReader() async { | |
| final vm_service.VM? vm = await vmService!.getVmGuarded(); | |
| if (vm == null) { | |
| globals.printError( | |
| 'Unable to initiate log reader for device' | |
| '${device?.name}, because the Flutter VM service connection ' | |
| 'is closed.', | |
| ); | |
| return; | |
| } | |
| final DeviceLogReader logReader = await device!.getLogReader(app: package); | |
| logReader.appPid = vm.pid; | |
| } |
Imagine reading this as a user. You would probably be confused. What is a Flutter VM service? Does this mean I won't see any logs at all? Does it mean I might see extraneous logs from other processes on the device?
Another thing: upon going through the implementations of tryInitLogReader, I've realized that this codepath only affects Android and iOS. This means that this warning message would be complete noise to web and desktop app developers.