Read owner and permissions from PUT response on new file creation#4105
Read owner and permissions from PUT response on new file creation#4105mpivchev wants to merge 7 commits into
Conversation
| @@ -0,0 +1,39 @@ | |||
| // SPDX-FileCopyrightText: Nextcloud GmbH | |||
There was a problem hiding this comment.
Separate Extension that can include all targets
| if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { | ||
| elementDate = "nc:metadata-photos-original_date_time" | ||
| lessDateString = String(lessDate.timeIntervalSince1970) | ||
| greaterDateString = String(greaterDate.timeIntervalSince1970) | ||
| } else { |
There was a problem hiding this comment.
Ex: 32 >= 999999?
This never happens? I removed it @marinofaggiana
| if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { | ||
| sortedByKeyPath = "datePhotosOriginal" | ||
| } else { |
There was a problem hiding this comment.
This never happens? I removed it @marinofaggiana
| if capabilities.serverVersionMajor >= self.global.nextcloudVersionFuture { | ||
| predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [ | ||
| NSPredicate(format: "datePhotosOriginal >= %@ AND datePhotosOriginal <= %@ AND mediaSearch == true", greaterDate as NSDate, lessDate as NSDate), | ||
| mediaPredicate | ||
| ]) | ||
| } |
There was a problem hiding this comment.
This never happens? I removed it @marinofaggiana
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates upload handling to persist per-file ownership/permission metadata from Nextcloud 34+ PUT responses, while also standardizing server-version checks using a comparable NextcloudVersion type and removing the obsolete “future” version gating.
Changes:
- Add
applyUploadResponse(...)to applyownerId/permissionsfrom upload responses when supported (NC 34+). - Refactor version checks to use
NCBrandOptions.shared.isServerVersion(..., greaterOrEqualTo: .vXX)/NextcloudVersion. - Remove deprecated “future version” logic and legacy version constants from
NCGlobal.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| iOSClient/Utility/NCLivePhoto.swift | Switch version gating to comparable version helper. |
| iOSClient/Networking/NCService.swift | Replace unsupported-version check with NextcloudVersion comparison. |
| iOSClient/Networking/NCNetworking+UploadResponse.swift | New helper to apply owner/permission metadata from PUT responses (NC 34+). |
| iOSClient/Networking/NCNetworking+Upload.swift | Thread owner/permission through upload result handling and call applyUploadResponse. |
| iOSClient/Networking/NCNetworking+NextcloudKitDelegate.swift | Extend upload delegate plumbing to include owner/permissions. |
| iOSClient/Networking/NCAutoUpload.swift | Switch to comparable server version checks for MKCOL support. |
| iOSClient/Networking/E2EE/NCNetworkingE2EEUpload.swift | Thread owner/permissions through E2EE upload results and apply them to metadata. |
| iOSClient/NCGlobal.swift | Remove Nextcloud version constants and “future” unsupported checks. |
| iOSClient/Menu/NCContextMenuProfile.swift | Switch to comparable version helper. |
| iOSClient/Menu/NCContextMenuPlus.swift | Switch to comparable version helper. |
| iOSClient/Media/NCMediaDataSource.swift | Remove dead “future version” branches; always use date. |
| iOSClient/Media/NCMedia+Netwoking.swift | Remove dead “future version” DAV date-field branches. |
| iOSClient/Main/Create/Upload Assets/NCUploadAssetsModel.swift | Switch to comparable version helper. |
| iOSClient/Main/Collection Common/NCCollectionViewCommon+Search.swift | Switch unified search gating to comparable version helper. |
| iOSClient/Data/NCMetadataTranfersSuccess.swift | Persist owner/permissions via applyUploadResponse when reporting success. |
| iOSClient/Assistant/NCAssistantModel.swift | Switch version check to comparable version helper. |
| Nextcloud.xcodeproj/project.pbxproj | Add new NCNetworking+UploadResponse.swift to project/targets. |
| File Provider Extension/FileProviderData.swift | Adopt .v32_0_2 version constant; apply owner/permissions after upload completion. |
| Brand/NCBrand.swift | Introduce NextcloudVersion and update isServerVersion API to accept it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NCKit: nextcloud/NextcloudKit#221
Implements: nextcloud/server#54088
Additional: