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

[Bug] Effects which are emitted in background can be missed in Compose #162

Open
rcmkt opened this issue Sep 2, 2022 · 1 comment
Open
Labels
bug Something isn't working

Comments

@rcmkt
Copy link
Contributor

rcmkt commented Sep 2, 2022

Preconditions:
There are two ElmFragments which are only container for Composable functions. Subscribe to Flow(Effect) with effects extension inside Composable fun.

Steps to reproduce:

  1. Open Fragment1 and navigate to Fragment2. Fragment1 subscribes via Actor to some data-holder.
  2. Trigger an event in Fragment2 which perform some work and update the data-holder from previous step.
  3. Reducer1 received event from Actor and produce effect, while Fragment1 is paused.
  4. Fragment2 is closed and Fragment1 didn't get effect.

IMPORTANT NOTE
It's related only for Flow. Due to research, I found that ElmScreen always subscribes to effects when Fragment is resumed. Since we manually subscribes to effects, this behavior broke the logic.
CoroutineScope inside Composable starts later than Fragment is get resume state, so ElmScreen consume effects but it shouldn't.

@diklimchuk
Copy link
Contributor

diklimchuk commented Sep 13, 2022

Hello. Do you have a working sample that reproduces this issue?

@diklimchuk diklimchuk added the bug Something isn't working label Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants