Conversation
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
|
@marinofaggiana Can you explain a bit what the issue was and what this changes |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses auto-upload error 423 (Locked) by improving error handling logic, refactoring the NCTransferDelegate protocol, and migrating NCDebouncer to use Swift's actor model for thread safety.
- Refactored
transferChangeprotocol method to pass individual parameters instead of the entiretableMetadataobject - Enhanced auto-upload error handling to specifically handle 404, 423, and other HTTP error codes
- Converted
NCDebouncerfrom Timer-based to actor-based implementation with Swift concurrency - Updated version to 7.2.1
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| iOSClient/Networking/NCNetworking.swift | Updated NCTransferDelegate protocol signature to pass individual parameters |
| iOSClient/Networking/NCNetworkingProcess.swift | Improved auto-upload logic to handle 423 and other errors, added transfer success cache check |
| iOSClient/Networking/NCNetworking+WebDAV.swift | Changed fileExists return type and improved error handling in createFileName and createFolderForAutoUpload |
| iOSClient/Utility/NCDebouncer.swift | Refactored to use actor model with async/await instead of Timer-based approach |
| iOSClient/Utility/NCUtilityFileSystem.swift | Improved numeric extraction logic using regular expressions |
| iOSClient/Data/NCManageDatabase+Metadata.swift | Moved and enhanced getMetadataProcess to filter out successful transfers |
| iOSClient/Data/NCManageDatabase+Metadata+Session.swift | Removed @discardableResult and return value from setMetadataSessionAsync, added clearMetadatasSessionAsync |
| Multiple viewer/UI files | Updated to match new transferChange signature and fetch metadata asynchronously |
| Nextcloud.xcodeproj/project.pbxproj | Updated version to 7.2.1 and reset build number |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | ||
| session: "", | ||
| sessionTaskIdentifier: 0, | ||
| sessionError: "", | ||
| selector: "", | ||
| status: self.global.metadataStatusNormal) |
There was a problem hiding this comment.
Inconsistent indentation with 3 spaces instead of the standard alignment. The parameters should align with the opening parenthesis or use consistent indentation throughout the call.
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | |
| session: "", | |
| sessionTaskIdentifier: 0, | |
| sessionError: "", | |
| selector: "", | |
| status: self.global.metadataStatusNormal) | |
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | |
| session: "", | |
| sessionTaskIdentifier: 0, | |
| sessionError: "", | |
| selector: "", | |
| status: self.global.metadataStatusNormal) |
| error: .success) | ||
| } | ||
| } else { | ||
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, |
There was a problem hiding this comment.
Inconsistent indentation with 3 spaces instead of the standard alignment. The parameters should align with the opening parenthesis or use consistent indentation throughout the call.
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | |
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, |
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | ||
| sessionTaskIdentifier: 0, | ||
| sessionError: error.errorDescription, | ||
| status: self.global.metadataStatusUploadError, | ||
| errorCode: error.errorCode) |
There was a problem hiding this comment.
Inconsistent indentation with 3 spaces instead of the standard alignment. The parameters should align with the opening parenthesis or use consistent indentation throughout the call.
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | |
| sessionTaskIdentifier: 0, | |
| sessionError: error.errorDescription, | |
| status: self.global.metadataStatusUploadError, | |
| errorCode: error.errorCode) | |
| await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId, | |
| sessionTaskIdentifier: 0, | |
| sessionError: error.errorDescription, | |
| status: self.global.metadataStatusUploadError, | |
| errorCode: error.errorCode) |
| await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId) | ||
| continue | ||
| } else if existsResult.errorCode == 404 { | ||
| // 404 Not Found → directory does not exist |
There was a problem hiding this comment.
The comment incorrectly states 'directory does not exist' but the context is checking if a file exists for auto-upload, not a directory. Should be 'file does not exist' for accuracy.
| // 404 Not Found → directory does not exist | |
| // 404 Not Found → file does not exist |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Marino Faggiana <[email protected]>
fix Auto upload error 423
move NCDebouncer in actor
improvements transferChange protocol
new version 7.2.1