-
Notifications
You must be signed in to change notification settings - Fork 0
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 remote resource support #2
Conversation
5f64c2a
to
8f29622
Compare
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.
Do we need to add anything more to the sample model to demonstrate expected use? Maybe in a follow up?
Yeah that's a good idea. Maybe I'll just make an attached file to the Word entity. |
…evant. Update db model snapshot test add remote resources support. add method to upload all pending local resources, and call from SyncWithResourceUpload helper method
e7b004c
to
034c3dc
Compare
# Conflicts: # src/SIL.Harmony/DataModel.cs # src/SIL.Harmony/Db/CrdtRepository.cs
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.
Nice work here 👍 💪
I just have a few thoughts 💭
…e but don't cancel and mark the upload as pending
# Conflicts: # src/SIL.Harmony.Tests/SIL.Harmony.Tests.csproj
the purpose of this is to investiage how to connect CRDTs and binary files (called resources here) which can't easily be stored as a CRDT directly.
Basically there's RemoteResources, these a tracked in CRDTs and can be referenced by other objects. They contain a reference to a resource on a remote server (auth left up to the app). Then there's a LocalResource, this represents a resource stored locally. There are 3 states a resource can be in.
if the file is local only then the RemoteResource.RemoteId will be null, indicating it has not yet been uploaded.
if DataModel.GetLocalResource returns null that means the resource has not yet been downloaded.
There are 2 apis to help the application list resources that are pending upload or pending download.
There is also an API to help upload resources before a sync.