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

Jetpack DataStore Integrations. #54

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

marukami
Copy link
Contributor

This is an initial attempt to integrate with Jetpack DataStore

This is very much a first draft. As I'm still trying to work out how and what is needed to have min changeset to have both SharedPreferences and DataStore

Would moving the shared logic into a Core module make it easier to support either or both SharedPreferences and DataStore?

Feedback is very much welcome.

NOTE Kotlin is required as DataStore takes a hard dependency on Kotlin coroutines.

Follows #53

@marukami
Copy link
Contributor Author

Update: Had a bit more time to work on this. There are a few things that I think would be needed here.

Since DataStore keeps everything in a single protobuf encoded byte array if the store changes… yer, it all falls apart. Encryption fails as the protobuff encode/decode will fail to work now after say adding a new field. So, my thinking is to try wrapping the user protobuf with a decorator proto to track meta-data. One issue with that idea is that this might need to take a hard dependency on a specific protobuf implementation.

@patrickfav To make DataStore work as a separate module some package-private classes need to be made public, so, would it make sense to pull all the common code into a Core module?

marukami and others added 4 commits March 6, 2021 16:06
Not sure this is the best approach, it will do for now until a better way comes around.
This is very much a first draft as we need to workout how this and the core module work together better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant