Skip to content

emit.forEach with restartable transformer emits both events #3888

Open
@vasilich6107

Description

@vasilich6107

Description
Hi @felangel . I'm working with restartable transformer.
Here is example with test

https://github.com/vasilich6107/bloc_stream_restartable

Steps To Reproduce
Run tests from test folder.

Expected Behavior
I'm making 2 async requests using variables1 and variables2.
On mock level I do some delays to emulate async requests.

With restartable transformer I assume that second bloc.run(variables2); will cancel previous handler.
As a result I expect

expect: () => [
        isA<QueryStateLoading<Map<String, dynamic>>>(),
        isA<QueryStateLoaded<Map<String, dynamic>>>(),
      ],

In reality I'm getting one loading state and 2 loaded.

Screenshots
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageThis issue requires triagepkg:bloc_concurrencyThis issue is related to the bloc_concurrency package

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions