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

DoStreamTransformer not behaving as expected #657

Open
rbellens opened this issue Jan 17, 2022 · 1 comment
Open

DoStreamTransformer not behaving as expected #657

rbellens opened this issue Jan 17, 2022 · 1 comment
Labels
under evaluation We are determining the bast way to approach this issue

Comments

@rbellens
Copy link

The DoStreamTransformer seems to be the only transformer that uses forwardStream with listenOnlyOnce argument equal to true. Don't exactly now what is the purpose of this argument, but it leads to some unexpected behavior in the following case:

var s = BehaviorSubject<dynamic>()..add(1);

var stream = s.doOnData((_) {});

var s1 = stream.listen((v) {
  print('$v'); // prints 1
});

await stream.first; // completes with value 1

await stream.first; // NEVER COMPLETES

await s1.cancel();
@hoc081098
Copy link
Collaborator

hoc081098 commented Jan 22, 2022

I have seen this issue too, but if we use Stream.multi for doOnXXX, doOnXXX's callback will fire many times even source Stream is broadcast.
#412 (comment)

@hoc081098 hoc081098 added the under evaluation We are determining the bast way to approach this issue label Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under evaluation We are determining the bast way to approach this issue
Projects
None yet
Development

No branches or pull requests

2 participants