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

feat: Store trait for unified client data access and observability #280

Merged
merged 17 commits into from
Jan 6, 2025

Conversation

boxdot
Copy link
Collaborator

@boxdot boxdot commented Jan 2, 2025

The new trait Store abstracts the access and modification of the
client data. Additionally, it adds observability to the changes in the
client data via the Store::subscribe method and the
StoreNotification type. The trait can be used as dependency inversion
between the app logic and the core client crates.

Currently, only the CoreUser implements the Store trait. The
observability is implemented via the StoreNotifier helper structure.
It is passed to the functions that modify data in the persistence layer.
The modifications are collected in a StoreNotification, and if the
corresponding operation succeeds, it is send to all current subscribers.

The cubits ConversationListCubitBase and
ConversationDetailsCubitBase now observe the changes in the client
data via the Store trait (instead of subscribing to the fetched
messages).

Closes #269
Closes #254

@boxdot boxdot changed the title feat: introduce a Store trait providing unified client data access and observability feat: Store trait for unified client data access and observability Jan 2, 2025
Copy link
Contributor

@raphaelrobert raphaelrobert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks like a good starting point.

@boxdot boxdot enabled auto-merge (squash) January 6, 2025 12:18
@boxdot boxdot merged commit d777589 into main Jan 6, 2025
13 checks passed
@boxdot boxdot deleted the dima/store-trait branch January 6, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants