Skip to content
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

Regression when switchMap is used together with asynchronous generator #764

Open
ky1vstar opened this issue Aug 26, 2024 · 1 comment
Open
Assignees

Comments

@ky1vstar
Copy link

ky1vstar commented Aug 26, 2024

Here is minimal reproducible example for regression which I found during migration from rxdart 0.27.7 to 0.28.0.

Dart SDK version: 3.5.1

Source code

import 'package:rxdart/rxdart.dart';

void main(List<String> arguments) async {
  getStream().listen(print);
}

Stream<String> getStream() {
  final stream1 = Future.delayed(Duration(seconds: 1), () => "1").asStream();
  final stream2 = stream1.startWith("2");

  final stream3 = stream2.switchMap((value) async* {
    await for (final innerValue in BehaviorSubject.seeded(value)) {
      yield innerValue;
    }
  });

  return stream3;
}

Expected result (rxdart 0.27.7):

2
1

Actual result (rxdart 0.28.0):

2

@ReactiveX ReactiveX deleted a comment Aug 26, 2024
@ReactiveX ReactiveX deleted a comment Aug 26, 2024
@ReactiveX ReactiveX deleted a comment Aug 26, 2024
@hoc081098
Copy link
Collaborator

hoc081098 commented Aug 28, 2024

possibly related to dart-lang/sdk#42717 (comment), dart-lang/sdk#56619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ky1vstar @hoc081098 and others