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

How to handle ifMatch properly in the put function options for Solid backend #1

Open
yasharpm opened this issue Jun 4, 2024 · 1 comment

Comments

@yasharpm
Copy link
Collaborator

yasharpm commented Jun 4, 2024

All backends (including the Solid backend) are subclasses of the RemoteBase class and Remote interface defined inside the remote.ts file. The description for the put function is as follows:

Create or update a file.
options.ifNoneMatch - When *, only create or update the file if it doesn't yet exist
options.ifMatch - Only saves if this matches current revision

Note that this function description is taken from the Dropbox backend. The GoogleDrive backend lacks the options.ifMatch description but behaves the same.

Studying the GoogleDrive code tells me that if the file already exists and the options.ifMatch is set, I have to check the ETAG of the file on the remote source and only update if it matches. Google drive already supports setting the etag and this condition in the update request to their server.

In order to implement the same for the Solid backend I could not find any similar functionality in the Inrupt library source code neither any mention of it in their documentation.

What should I do here? I can ignore the etag and change the put function description for the solid backend. Or maybe if this is basically possible in the Solid protocol and implementations, I can come up with a pull request to the Inrupt library or even find a hack.

@yasharpm
Copy link
Collaborator Author

yasharpm commented Jun 4, 2024

@michielbdejong thoughts?

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

No branches or pull requests

1 participant