Skip to content

Comments

Auto Upload#3873

Merged
marinofaggiana merged 8 commits intomasterfrom
selectorUploadAutoUpload
Nov 12, 2025
Merged

Auto Upload#3873
marinofaggiana merged 8 commits intomasterfrom
selectorUploadAutoUpload

Conversation

@marinofaggiana
Copy link
Member

@marinofaggiana marinofaggiana commented Nov 12, 2025

fix Auto upload error 423
move NCDebouncer in actor
improvements transferChange protocol
new version 7.2.1

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]>
@mpivchev
Copy link
Collaborator

@marinofaggiana Can you explain a bit what the issue was and what this changes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 transferChange protocol method to pass individual parameters instead of the entire tableMetadata object
  • Enhanced auto-upload error handling to specifically handle 404, 423, and other HTTP error codes
  • Converted NCDebouncer from 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.

Comment on lines +208 to +213
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId,
session: "",
sessionTaskIdentifier: 0,
sessionError: "",
selector: "",
status: self.global.metadataStatusNormal)
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
error: .success)
}
} else {
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId,
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId,
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId,

Copilot uses AI. Check for mistakes.
Comment on lines +342 to +346
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: metadata.ocId,
sessionTaskIdentifier: 0,
sessionError: error.errorDescription,
status: self.global.metadataStatusUploadError,
errorCode: error.errorCode)
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocId)
continue
} else if existsResult.errorCode == 404 {
// 404 Not Found → directory does not exist
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 404 Not Found → directory does not exist
// 404 Not Found → file does not exist

Copilot uses AI. Check for mistakes.
marinofaggiana and others added 2 commits November 12, 2025 15:03
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]>
@marinofaggiana marinofaggiana merged commit da43088 into master Nov 12, 2025
4 of 5 checks passed
@marinofaggiana marinofaggiana deleted the selectorUploadAutoUpload branch November 12, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants