Skip to content

DDC async* bug - another flavor with more awaits #42764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mrmax99 opened this issue Jul 20, 2020 · 5 comments
Open

DDC async* bug - another flavor with more awaits #42764

mrmax99 opened this issue Jul 20, 2020 · 5 comments
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. dev-compiler-async web-dev-compiler

Comments

@mrmax99
Copy link

mrmax99 commented Jul 20, 2020

I'm hitting another variant of this bug:
#39994

It only reproduces for me on web / DDC.

Expected output (just running in dart on the console works correctly):

Hello, World 1!
Hello, World 2!
[hello, hello]

Output when running a flutter web debug app on chrome:

Hello, World 1!

Relevant code portion:

  Stream<String> testStream(String test) async* {
    yield test;
    try {
      await testFunction1();
      yield test;
    } catch (e) {
      print('Hello, World 1!');
      await testFunction2();
      print('Hello, World 2!');
      yield test;
    }
  }

  Future<String> testFunction1() async {
    throw Exception("test");
  }

  Future<String> testFunction2() async {
    return "foo";
  }


void main() async {
  var stream = testStream("hello");
  print(await stream.toList());
}

My version info:

> dart --version
Dart VM version: 2.9.0-14.1.beta (beta) (Tue Jun 9 10:52:57 2020 +0200) on "windows_x64"
> flutter --version
Flutter 1.19.0-4.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 8fe7655ed2 (3 weeks ago) • 2020-07-01 14:31:18 -0700
Engine • revision 9a28c3bcf4
Tools • Dart 2.9.0 (build 2.9.0-14.1.beta)
@lrhn lrhn added area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. web-dev-compiler labels Jul 20, 2020
@mrmax99
Copy link
Author

mrmax99 commented Oct 1, 2020

Tagging @vsmenon @Markzipan since they seemed involved in the related bug, in case they weren't aware of this one. It's pretty frustrating to hit this and it makes debugging flutter web code a huge pain.

@Markzipan
Copy link
Contributor

Thanks for finding this - checking this out now. Making the web's async semantics consistent is on our roadmap, so this is another data point to escalate its priority.

@vsmenon
Copy link
Member

vsmenon commented Oct 1, 2020

fyi - @sigmundch

@mrmax99
Copy link
Author

mrmax99 commented Feb 20, 2021

any update on this?

@Markzipan
Copy link
Contributor

Sorry about the delay, Max. These discrepancies with DDC's async generator are on our radar, but we've been prioritizing other items at the moment. I'll resume fiddling here soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. dev-compiler-async web-dev-compiler
Projects
None yet
Development

No branches or pull requests

4 participants