Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Sep 25, 2020

Description

Flutter logs should not attempt to filter the device list based on the current project, because it does not require a current project. Also fix disabled polling test

Fixes #47996
Fixes #63550

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 25, 2020
Future<List<Device>> pollingGetDevices({ Duration timeout });

Future<void> startPolling() async {
void startPolling() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of these methods do not need to be async - this made it much easier to fix the disabled test

}
}

typedef DispatchCommand = void Function(Map<String, dynamic> command);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes just make the async APIs sync like the underlying code

@override
Future<FlutterCommandResult> verifyThenRunCommand(String commandPath) async {
device = await findTargetDevice();
device = await findTargetDevice(includeUnsupportedDevices: true);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only change for the log command

group('PollingDeviceDiscovery', () {
testUsingContext('startPolling', () async {
await FakeAsync().run((FakeAsync time) async {
testUsingContext('startPolling', () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test was disabled, now it works again yay

@jonahwilliams
Copy link
Contributor Author

@Hixie as the primary user of flutter logs would you like to review? 😃

@jonahwilliams jonahwilliams requested review from jmagman and removed request for jmagman October 1, 2020 15:54
typedef DispatchCommand = void Function(Map<String, dynamic> command);

typedef CommandHandler = Future<dynamic> Function(Map<String, dynamic> args);
typedef CommandHandler = FutureOr<dynamic> Function(Map<String, dynamic> args);
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I would strongly prefer we never use FutureOr. It leads to all kinds of issues later.

Copy link
Contributor

Choose a reason for hiding this comment

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

not quite sure i understand where this ends up mattering

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, its not necessary

Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM module the FutureOr. But I suspect that means something else major has to change...?

@jonahwilliams
Copy link
Contributor Author

Fixed the FutureOr issue :) , NBD

@jonahwilliams
Copy link
Contributor Author

Landing to kick the tree - the last red test passed but the build status is stuck

@jonahwilliams jonahwilliams merged commit 1bea512 into flutter:master Oct 3, 2020
@jonahwilliams jonahwilliams deleted the fix_clean branch October 3, 2020 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"flutter logs" has confused error message "flutter logs" claims "No supported devices connected." when not run in directory with pubspec.yaml

3 participants