-
Notifications
You must be signed in to change notification settings - Fork 10
Feature/download sync #79
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: main
Are you sure you want to change the base?
Conversation
- Switch to External Storage Directory in ScopedStorageProvider. - Request MANAGE_EXTERNAL_STORAGE permission on Android R+. - Use Space names instead of IDs for folder structure. - Rename data folder to OpenCloud.
…iles - Root cause: refreshFolder() only returned changed files, not all - Solution: Use getFolderContent(folderId) after refresh to get ALL files from DB - Add recursive folder traversal with proper refresh before each folder scan - Improve LocalFileSyncWorker with better statistics and notifications - Remove setForegroundAsync to fix Android 14+ foreground service crash
187f570 to
0f69672
Compare
|
This is a killer feature! Also, how does background sync work in regards of battery management in Android? |
Changed avatar endpoint from legacy /index.php/avatar/ to /graph/v1.0/me/photo/ for openCloud compatibility.
When a file changes both locally and remotely, automatically upload the local version instead of requiring manual conflict resolution. This provides a seamless auto-sync experience (last write wins).
When a file changes both locally and remotely, automatically upload |
I don't think that's the best way to handle this. Desktop version pulls the file on conflict and names it I think we shouldn't be overwriting remote work, at least not without user confirmation. |
| if (!android.os.Environment.isExternalStorageManager()) { | ||
| val builder = AlertDialog.Builder(this) | ||
| builder.setTitle(getString(R.string.app_name)) | ||
| builder.setMessage("To save offline files, the app needs access to all files.") |
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.
This strings should probably be translated
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.
Yes, can do micro patch later
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.
lets have focus on implementing the sync stuff perfectly, translation etc can be done later
| <string name="db_file" formatted="false">opencloud.db</string> | ||
| <string name="db_name" formatted="false">OpenCloud</string> | ||
| <string name="data_folder" formatted="false">opencloud</string> | ||
| <string name="data_folder" formatted="false">OpenCloud</string> |
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.
Is this necesarry?
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.
looks better
But whats issue with last write win strategy? The manual user interaction is really bad UX, the Sync before that sync rework worked, but showed conflict. Its just very very unlikely that it will become an issue. The overwrite happens only if i change the file and save it. I think UX should imo have more priority, cuz thats a ~1% chance that it causes issues |
So should we just add the conflict stuff again with a easy option "last write win" ? how should it be solved without causing a really really bad UX? |
Have to test it, but i didn't have both open at same time. I only tested editing something, closing on web, editing 2 seconds later on Android. I planned to test that scenario today |
|
@samolego When both local and remote have changed, download the remote version AND keep the local file renamed as filename_conflicted_copy_.ext |
…e is modified both locally and remotely, create a conflicted copy of the local file and download the remote version. This ensures no data loss, matching desktop client behavior.
…es the conflicted copy visible in the app's file list immediately after sync conflict resolution
… in Security settings to choose conflict resolution strategy - When enabled: upload local version (overwrites remote) - When disabled (default): create conflicted copy and download remote - Ensures no data loss while giving users control over conflict behavior
…eSystemWorker now checks for conflicts when forceOverwrite=true - Creates local conflicted copy before uploading when remote changed - Respects 'prefer local on conflict' setting - Works even without Auto-Sync enabled
|
Please test it, and give feedback. edit: Conflict files are in the OpenCloud Folder, not on Server |
Download and Sync Feature
Summary
This PR adds the ability to download all files from the server and keep them synchronized locally. Users can now enable offline access for their entire account through the settings.
Changes
External Storage with Human-Readable Folder Names
Sync Option and Download All Files
DownloadEverythingWorkerto handle bulk downloadsLocalFileSyncWorkerto keep local files in sync with the serverWorker Improvements
DownloadEverythingWorkerto properly iterate through all folders and filesLocalization
Testing
Related Issues
#24