Skip to content

Conversation

@hahn-kev
Copy link
Collaborator

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.

  • local only
  • remote only
  • remote and local

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.

Base automatically changed from add-crdt to main June 5, 2024 13:35
@hahn-kev hahn-kev force-pushed the remote-resources branch 2 times, most recently from 5f64c2a to 8f29622 Compare June 5, 2024 15:38
Copy link

@jasonleenaylor jasonleenaylor left a 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?

@hahn-kev
Copy link
Collaborator Author

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
@hahn-kev hahn-kev requested a review from myieye November 14, 2024 08:54
Copy link
Contributor

@myieye myieye left a 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 💭

@hahn-kev hahn-kev merged commit 8a0bd5d into main Dec 17, 2024
4 checks passed
@hahn-kev hahn-kev deleted the remote-resources branch December 17, 2024 04:44
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.

4 participants