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

eTag support with If-Match #534

Open
symphony-enrico opened this issue Mar 11, 2024 · 2 comments
Open

eTag support with If-Match #534

symphony-enrico opened this issue Mar 11, 2024 · 2 comments

Comments

@symphony-enrico
Copy link
Contributor

symphony-enrico commented Mar 11, 2024

Hello, I see that If-None-Match is supported well (if etag matches, an exception is throw), but If-Match, very useful for consistency of PUT operation, looks like not working and it is not clear to me if it is a not supported yet feature or a real bug.

I wondering if the version read from If-Match header should be passed to Repository#update (to delegate the implementation to check this) : now there is a version field, but it seems initialized with 'ETag' header, not with If-Match.

Thanks!

@symphony-enrico symphony-enrico changed the title eTag support eTag support with If-Match Mar 11, 2024
@bdemers
Copy link
Member

bdemers commented Mar 11, 2024

Thanks for the report @symphony-enrico!

ETag support for updates was pushed down to the repository level (the ETag header maps to the version) in the Repository.update(...) method.

The intent was to allow Repository implementations to make more performant checks to see if the etag/version matches. Before #411, this was not the case. Which forced a (potentially expensive) call to repository.get(id) that was then used to calculate the version/etag. Now implementations optimize this how they see fit, e.g. add an index row to a database containing a version field.

As you mentioned, the current implementation may not be accurate (doesn't match for If-Match headers). If you have suggestions on how to improve this please let us know! (Either in this issue, or a PR!)

@symphony-enrico
Copy link
Contributor Author

symphony-enrico commented Mar 12, 2024

Hello @bdemers IMHO there is a really simple modification to do:

#541

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

2 participants