Skip to content

Conversation

@xster
Copy link
Member

@xster xster commented Jun 16, 2017

#10754

Before I get too far, here's a sampling to make sure it's what we want.

@xster xster requested review from Hixie and tvolkert June 16, 2017 01:08
@tvolkert
Copy link
Contributor

LGTM!

@xster xster merged commit 45446ae into flutter:master Jun 16, 2017
@xster xster deleted the unawaited-future-1 branch June 16, 2017 01:49
final String branch = _channel == 'alpha' ? 'alpha' : 'master';
final DateTime remoteFrameworkCommitDate = DateTime.parse(await FlutterVersion.fetchRemoteFrameworkCommitDate(branch));
// fire and forget since nothing subsequent depends on it. Hope there's a flush/sync mechanism.
// ignore: unawaited_futures
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks ok in this case but as a general rule prefer to put the //ignore at the end of the offending line rather than before it

Copy link
Member Author

Choose a reason for hiding this comment

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

May be a bug. Doesn't seem to actually work on multi-line expressions when it's like:

aFutureReturningFunction(
  a,
  b
); // ignore: unawaited_futures

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @leafpetersen but maybe try:

aFutureReturningFunction( // ignore: unawaited_futures
  a,
  b
);

try {
final String branch = _channel == 'alpha' ? 'alpha' : 'master';
final DateTime remoteFrameworkCommitDate = DateTime.parse(await FlutterVersion.fetchRemoteFrameworkCommitDate(branch));
// fire and forget since nothing subsequent depends on it. Hope there's a flush/sync mechanism.
Copy link
Contributor

Choose a reason for hiding this comment

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

This hope seems optimistic...

cc @yjbanov did you mean to not wait for this future?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a bug. I think we should await. I usually leave a comment if I'm dropping a Future on the floor intentionally.

);
await new Future<Null>.delayed(kPauseToLetUserReadTheMessage);
await Future.wait<Null>(<Future<Null>>[
saveWarningStampFuture,
Copy link
Contributor

Choose a reason for hiding this comment

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

feel free to just inline the future-returning calls in the Future.wait call, fwiw.

Copy link
Member Author

Choose a reason for hiding this comment

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

sent a follow up #10786
Do wish this syntax was more succinct/readable though

gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jul 1, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants