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

Add the hash to RuleLocal table #46

Open
wkornewald opened this issue Jul 22, 2021 · 0 comments
Open

Add the hash to RuleLocal table #46

wkornewald opened this issue Jul 22, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@wkornewald
Copy link

Currently, the RuleLocal class/table doesn't contain a hash field. This means that users of this library have to manually also track the hash of each rule in a separate DB/table (which can cause inconsistency, etc.). It also means that efficiently syncing the backend with the database is more involved. The current DefaultRulesRepository doesn't even do a hash comparison.

With a hash field every RuleLocal could also store the corresponding hash to allow easy comparison and minimal updates.

Our implementation with hash comparison looks like this in case you want to reuse some of the code: https://github.com/Digitaler-Impfnachweis/covpass-android/blob/main/covpass-sdk/src/main/java/de/rki/covpass/sdk/rules/DefaultCovPassRulesRepository.kt

However that's based on an additional database for storing the hashes. We could do away with that extra complexity by simply having that extra field and if you reuse our sync algorithm we could also get rid of that extra code and this lib would be nicely usable out of the box (apart from all the dependencies issue as mentioned in #32 and the missing Maven Central or GitHub Packages publication mentioned in #12).

@wkornewald wkornewald added the enhancement New feature or request label Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants