-
Notifications
You must be signed in to change notification settings - Fork 74
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
Unify Storage Backends #734
Conversation
c1a8bbc
to
574cca6
Compare
574cca6
to
6d5fc9b
Compare
This creates a KeyManager interface in the new core module which the storage module can use to get the key from.
because it is one extra request for packages that do have data and from the looks of it not really needed.
When changing backends, the ChunkWriter could still use the old one causing data loss, because chunks assumed to exist on new backend, were written to old one.
6d5fc9b
to
78ef0ca
Compare
I've been running this on my daily driver and haven't encountered problems. I've been seeing notifications of successful backups daily. I tested restoring a single app after making a small change - a notes app - and it appears to work fine. Haven't done full-blown testing, but haven't encountered errors, either. I use WebDAV as a backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me as per my last comment.
We had two storage plugin interfaces: One for app backup and one for files backup. Therefore we had two different WebDAV implementations and two different Storage Access Framework implementations. The storage interface was application specific to its use-case.
This MR unifies those implementations using a single storage backend interface which is rather generic and mostly independent of application specific use cases:
This should make writing new storage backends easier. It reduces lots of duplicated code and allows for future modernizations such as retrying operations after I/O errors.
The new unified implementations also improve upon their old separate implementations. There are no more
init()
orstartRestoreSet()
methods where we created new folders. Instead, all folders are now created on-demand, only when they are needed and in the case of SAF also cached for faster access. Initializing a new backup location is faster, because we don't need to create the 255 folders for file backup.The implementation now lives in a new
core
gradle module, so theapp
and thestorage
module can both make use of it. In the future, common cryptographic code should also get moved there to further reduce duplication.