Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Fix a StreamGroup bug when a component stream's listen() throws #173

Merged
merged 2 commits into from
Apr 29, 2021

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Apr 28, 2021

This would put the StreamGroup into an inconsistent state where it
would believe itself to be active, but only some streams would have
subscriptions. This was exacerbated by dart-lang/sdk#45815, which
meant that even though _onListen threw an error a StreamSubscription
was created and returned, so further callbacks could still be called.

Now instead of going into an inconsistent state, the StreamGroup
simply cancels itself.

This would put the StreamGroup into an inconsistent state where it
would believe itself to be active, but only some streams would have
subscriptions. This was exacerbated by dart-lang/sdk#45815, which
meant that even though _onListen threw an error a StreamSubscription
was created and returned, so further callbacks could still be called.

Now instead of going into an inconsistent state, the StreamGroup
simply cancels itself.
@nex3 nex3 requested a review from lrhn April 28, 2021 21:56
@google-cla google-cla bot added the cla: yes label Apr 28, 2021
lib/src/stream_group.dart Show resolved Hide resolved
lib/src/stream_group.dart Show resolved Hide resolved
@nex3 nex3 merged commit cde00b8 into master Apr 29, 2021
@nex3 nex3 deleted the stream-group-listen-error branch April 29, 2021 21:49
nex3 added a commit that referenced this pull request May 3, 2021
I forgot to actually push these to the pull request.
nex3 added a commit that referenced this pull request May 4, 2021
I forgot to actually push these to the pull request.
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 14, 2024
…-archive/async#173)

This would put the StreamGroup into an inconsistent state where it
would believe itself to be active, but only some streams would have
subscriptions. This was exacerbated by dart-lang/sdkdart-lang/async#45815, which
meant that even though _onListen threw an error a StreamSubscription
was created and returned, so further callbacks could still be called.

Now instead of going into an inconsistent state, the StreamGroup
simply cancels itself.
mosuem pushed a commit to dart-lang/core that referenced this pull request Oct 14, 2024
I forgot to actually push these to the pull request.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

2 participants