-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
BugFix - Offline Operation Conflict Handling #15027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -57,32 +56,6 @@ class FileUploaderIntents(private val context: Context) { | |||
) | |||
} | |||
|
|||
fun resultIntent(resultCode: ResultCode, operation: UploadFileOperation): PendingIntent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused function
542a8b0
to
7637906
Compare
20698bd
to
5d98ad4
Compare
…tion if delete op successfully completed, change text delete offline folder to delete file or delete folder Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Co-authored-by: kramo <[email protected]> Signed-off-by: Alper Öztürk <[email protected]>
2b6134b
to
666c051
Compare
Signed-off-by: alperozturk <[email protected]>
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15027.apk |
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed. |
This PR improves the handling of file and folder conflicts during offline operations.
Changes:
Removed the HashMap previously used in
RefreshFolderOperation
andOfflineOperationActionReceiver
.Conflict detection is now handled directly by
OfflineOperationWorker
.Conflict detection logic checks if the target path already exists on the server. If it does, a conflict is assumed.
Handling Conflicts
Since offline operations do not have access to server-side metadata such as eTags, we cannot reliably compare local and remote versions of a file or folder. To prevent unintended overwrites: If the remote path exists, we treat it as a conflict.
Handling Create File & Create Folder
Users are prompted with a
ConflictResolveDialog
to choose how to proceed.Handling Remove & Rename
User interaction is not allowed via
ConflictResolveDialog:
These operations lack meaningful resolution options like "Keep Local."
For example, if a user modified a folder on the server and another offline operation attempted to delete the same folder, prompting the user to "keep local" would result in deleting the modified folder, which is not intuitive.
Supporting (Delete Folder, Delete File, Rename Folder, Rename File -- which files in the folder can be deleted which ones not etc.) these operations in the
ConflictResolveDialog
would introduce unnecessary complexity.Instead:
Users are notified of the conflict via a notification.
The corresponding offline operation is removed from the database.
If the user still intends to rename or delete the file/folder, they can manually retry the operation.