Skip to content

Jetpack DataStore Integrations.#54

Open
mtilbrook-dev wants to merge 4 commits intopatrickfav:mainfrom
mtilbrook-dev:datastore
Open

Jetpack DataStore Integrations.#54
mtilbrook-dev wants to merge 4 commits intopatrickfav:mainfrom
mtilbrook-dev:datastore

Conversation

@mtilbrook-dev
Copy link
Copy Markdown
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

@mtilbrook-dev
Copy link
Copy Markdown
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?

mtilbrook-dev 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.

1 participant