Merged
Conversation
- Removed FileProviderLogDetailKey.metadata because it was intended for Realm data models which actually are unsafe to pass across concurrency domains and caused a crash while doing so. - Removed FileProviderLogDetailKey.ocId because it is the same as "item" which is intended for the primary key of file provider items. Signed-off-by: Iva Horn <iva.horn@icloud.com>
- It was specific to the SendableItemMetadata implementation before. - It actually belongs into the common requirements definition of ItemMetadata. Signed-off-by: Iva Horn <iva.horn@icloud.com>
- Lock tokens are available only once during the LOCK request. - During every follow up request like PROPFIND, they are not returned for any item. - The items in the client database are updated atomically with the remote state. - The remote state does not provide the lock token. - So, during any metadata update after locking an item, the locally stored lock token is lost because it is overwritten with the new empty value retrieved from the server. Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
- When a file is either locked or unlocked because of a lock file, its metadata must be updated accordingly. Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
…incorrect error. Signed-off-by: Iva Horn <iva.horn@icloud.com>
Signed-off-by: Iva Horn <iva.horn@icloud.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
A comprehensive fix for token-based file locking functionality, updating lock-related APIs, data structures, and logging systems.
- Removed obsolete lock properties and simplified lock data model
- Updated logging system to use standardized keys and improved formatting
- Enhanced lock file management with proper token handling and metadata updates
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/NextcloudFileProviderKitTests/RemoteChangeObserverEtagOptimizationTests.swift | Consolidated multi-line assertion into single line |
| Tests/NextcloudFileProviderKitTests/ItemModifyTests.swift | Removed version-specific error handling for lock tests |
| Tests/Interface/MockRemoteItem.swift | Simplified lock properties and updated lock initialization |
| Sources/NextcloudFileProviderKit/Metadata/SendableItemMetadata.swift | Removed lockToken assignment and cleaned up comments |
| Sources/NextcloudFileProviderKit/Metadata/SendableItemMetadata+Array.swift | Updated logging keys from .ocId to .item |
| Sources/NextcloudFileProviderKit/Metadata/ItemMetadata.swift | Moved and improved documentation for isLockFileOfLocalOrigin |
| Sources/NextcloudFileProviderKit/Log/FileProviderLogDetailKey.swift | Consolidated logging keys and added Comparable conformance |
| Sources/NextcloudFileProviderKit/Log/FileProviderLogDetail.swift | Added null safety for lock editor field |
| Sources/NextcloudFileProviderKit/Log/FileProviderLog.swift | Enhanced logging with sorted keys and improved type handling |
| Sources/NextcloudFileProviderKit/Item/Item.swift | Updated lock capability logic and file system flags |
| Sources/NextcloudFileProviderKit/Item/Item+Modify.swift | Added lock token header support and improved logging |
| Sources/NextcloudFileProviderKit/Item/Item+LockFile.swift | Enhanced lock/unlock with metadata synchronization |
| Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift | Standardized logging throughout fetch operations |
| Sources/NextcloudFileProviderKit/Extensions/NKFile+Extensions.swift | Updated lock property mappings to use individual fields |
| Sources/NextcloudFileProviderKit/Enumeration/RemoteChangeObserver.swift | Consolidated logging statements |
| Sources/NextcloudFileProviderKit/Enumeration/MaterialisedEnumerationObserver.swift | Updated logging keys for consistency |
| Sources/NextcloudFileProviderKit/Enumeration/Enumerator.swift | Improved error handling and logging standardization |
| Sources/NextcloudFileProviderKit/Enumeration/Enumerator+Trash.swift | Updated logging key usage |
| Sources/NextcloudFileProviderKit/Enumeration/Enumerator+SyncEngine.swift | Added guard clause and lock token preservation |
| Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager.swift | Updated logging keys and improved method formatting |
| Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager+KeepDownloaded.swift | Updated logging keys for consistency |
| Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager+Directories.swift | Updated logging keys throughout directory operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Iva Horn <iva.horn@icloud.com>
nilsding
reviewed
Oct 13, 2025
Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
nilsding
approved these changes
Oct 13, 2025
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.
Depends on this being integrated first:nextcloud/NextcloudKit#193
Done.