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

Consolidate state management #23543

Open
2 tasks
Tracked by #24660 ...
turt2live opened this issue Oct 18, 2022 · 1 comment
Open
2 tasks
Tracked by #24660 ...

Consolidate state management #23543

turt2live opened this issue Oct 18, 2022 · 1 comment
Labels
A-Developer-Experience A-Technical-Debt T-Epic Issue is at Epic level T-Task Tasks for the team like planning

Comments

@turt2live
Copy link
Member

turt2live commented Oct 18, 2022

Why?

In-memory state is held in a variety of stores following different patterns. This makes it hard to reason about the code, complicates changes and prevents multi-account support.

What?

We’ll devise a unified pattern for storing state and migrate all existing stores to the new system.

Plan

Tasks

Internal references

myhours: https://app.myhours.com/#/projects/2028403/overview

@turt2live turt2live added T-Task Tasks for the team like planning A-Developer-Experience T-Epic Issue is at Epic level labels Oct 18, 2022
@kegsay
Copy link
Contributor

kegsay commented Oct 19, 2022

Immediate term:

Short term:

  • Convert other stores one by one to this new format, either by myself or by other willing contributors. Add Jest tests for each store when they get converted, mocking out other store dependencies and using untilEmission and untilDispatch to improve test reliability and reduce brittleness of earlier await styles and hard dependencies on other concrete store impls.

Medium term:

  • When all stores are converted, remove SdkContextClass.instance - this would remove all stores from being accesible globally and pave the way for multi-account support. If you need stores, you'd either need to useContext if in a React component, or accept an instace of SdkContextClass in your constructor, which is the dependency injected at startup (e.g in MatrixChat).

@Johennes Johennes changed the title Epic: State management within the app Consolidate state management Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience A-Technical-Debt T-Epic Issue is at Epic level T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

3 participants