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

Guarantee early actions reach target reducers when app is initializing #163

Open
sassanh opened this issue Aug 19, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@sassanh
Copy link
Collaborator

sassanh commented Aug 19, 2024

Problem: When app is initializing, one service may dispatch an action and one of its consumers may not be running yet. For example keypad service dispatches the action for setting the mute button state but audio service may not be up yet.

Solutions:

  1. Implement a dependency mechanism for services: currently they run in order but there is no guarantee OS prioritizes a thread just cause it ran before another thread. So we can consider adding a mechanism which doesn't run the next thread until the previous thread has registered its reducer. (This is the safest but it will probably make the initialization very slow.)
  2. Explicitly make the redux store go into a state in which it only buffers actions and only runs reducer registrations, then again explicitly exit this state and signal redux to dispatch all buffered actions in order.
  3. Instead of handling it in redux package, handle it in a middleware in ubo-app.
@sassanh sassanh added this to Ubo App Aug 19, 2024
@sassanh sassanh self-assigned this Aug 19, 2024
@sassanh sassanh converted this from a draft issue Aug 19, 2024
@sassanh sassanh added the bug Something isn't working label Aug 19, 2024
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
Status: No status
Development

No branches or pull requests

1 participant