fix(files): add FsNode.etag_unquoted, keep etag as the server sent it - #456
Merged
Conversation
📝 WalkthroughWalkthrough
ChangesETag normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant DAVServer
participant FsNode
participant Client
DAVServer->>FsNode: Return server-provided quoted ETag
FsNode->>Client: Expose etag and etag_unquoted
Client->>DAVServer: Send quoted ETag in conditional DAV headers
DAVServer-->>Client: Return 304 or accept conditional PUT
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The trashbin answers with an empty `<d:getetag/>`, which arrived as None despite the str annotation, so FsNode.etag was not always a string. Normalize that to "" and add FsNode.etag_unquoted for callers that want the bare tag. `etag` itself keeps exactly what the server sent, quotes included, so it can still be passed to an If-Match/If-None-Match header unchanged. Stripping the quotes from `etag` would have broken that: the server answers 412 to a conditional write and silently ignores the precondition on a conditional read. Closes #448 Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #456 +/- ##
==========================================
+ Coverage 94.69% 94.79% +0.10%
==========================================
Files 48 50 +2
Lines 5650 5767 +117
==========================================
+ Hits 5350 5467 +117
Misses 300 300
🚀 New features to boost your workflow:
|
oleksandr-nc
force-pushed
the
fix/etag-quotes
branch
from
August 3, 2026 15:05
5f15f8e to
9611972
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FsNode.etagkeeps what the server sent, quotes included, so it can be passed to anIf-Match/If-None-Matchheader unchanged. Stripping them there would break that, measured against NC 35: the server answers 412 to a conditional write and silently ignores the precondition on a conditional read (200 instead of 304). The quotes are part of the entity tag (RFC 9110 §8.8.3).FsNode.etag_unquotedfor callers that want the bare tag, which is what Quoted E-Tags may be stripped #448 asks forFsNode.etagis always astrnow: the trashbin sends an empty<d:getetag/>, which used to arrive asNoneCloses #448
Summary by CodeRabbit
New Features
etag_unquotedfor retrieving ETags without surrounding quotation marks.etagnow preserves the server-provided format for direct use in conditional request headers.Bug Fixes