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

emit.forEach with restartable transformer emits both events #3888

Open
vasilich6107 opened this issue Jun 24, 2023 · 4 comments
Open

emit.forEach with restartable transformer emits both events #3888

vasilich6107 opened this issue Jun 24, 2023 · 4 comments
Labels
bug Something isn't working needs triage This issue requires triage pkg:bloc_concurrency This issue is related to the bloc_concurrency package

Comments

@vasilich6107
Copy link

vasilich6107 commented Jun 24, 2023

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

@vasilich6107 vasilich6107 added the bug Something isn't working label Jun 24, 2023
@vasilich6107
Copy link
Author

vasilich6107 commented Jun 24, 2023

I've also checked this issue with no luck
#3349 (comment)

@vasilich6107
Copy link
Author

Hi @felangel
Could you help with this issue

@vasilich6107
Copy link
Author

Could anyone clarify the correctness of my approach?

@vasilich6107
Copy link
Author

Good morning @felangel
Could you take a look

@felangel felangel added needs triage This issue requires triage pkg:bloc_concurrency This issue is related to the bloc_concurrency package labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage This issue requires triage pkg:bloc_concurrency This issue is related to the bloc_concurrency package
Projects
None yet
Development

No branches or pull requests

2 participants