Expose LOCK response ETag on NKLock - #249
Merged
Merged
Conversation
Co-authored-by: Rello <13385119+Rello@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Rello
August 21, 2026 12:15
View session
Rello
marked this pull request as ready for review
August 24, 2026 07:30
i2h3
approved these changes
Aug 24, 2026
There was a problem hiding this comment.
Pull request overview
Exposes normalized LOCK response ETags through NKLock without changing request behavior.
Changes:
- Adds optional
etagparsing and raw initialization support. - Adds tests for quoted, unquoted, and missing ETags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Sources/NextcloudKit/Models/NKLock.swift |
Adds and populates the optional ETag property. |
Tests/NextcloudKitUnitTests/NKLockUnitTests.swift |
Covers LOCK token and ETag parsing behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
NKLockdid not surface the resource ETag already returned by successful WebDAVLOCKresponses, forcing callers to operate without metadata that was already available in the response body. This change keeps the existing lock/unlock flow intact and makes the parsed LOCK ETag available directly on the lock model.Model update
etag: String?toNKLock.d:getetagfrom the existing LOCK XML payload inNKLock.init(xml:).etagparameter defaulting tonilto preserve source compatibility.Parsing behavior
d:getetagcontinues to produce a validNKLock.Unit coverage
NKLockUnitTestsfor: