Jetpack DataStore Integrations.#54
Open
mtilbrook-dev wants to merge 4 commits intopatrickfav:mainfrom
Open
Conversation
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? |
b9c674a to
1b18c52
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
SharedPreferencesandDataStoreWould moving the shared logic into a Core module make it easier to support either or both
SharedPreferencesandDataStore?Feedback is very much welcome.
NOTE Kotlin is required as DataStore takes a hard dependency on Kotlin coroutines.
Follows #53