Feature: Offline Mode, Auto-Sync & File Manager Visibility#79
Feature: Offline Mode, Auto-Sync & File Manager Visibility#79zerox80 wants to merge 2 commits intoopencloud-eu:mainfrom
Conversation
187f570 to
0f69672
Compare
|
This is a killer feature! Also, how does background sync work in regards of battery management in Android? |
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.
This strings should probably be translated
There was a problem hiding this comment.
Yes, can do micro patch later
There was a problem hiding this comment.
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> |
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 |
|
Please test it, and give feedback. edit: Conflict files are in the OpenCloud Folder, not on Server |
c55b72f to
644300d
Compare
5213458 to
53d61ae
Compare
848a08e to
06f0356
Compare
c139384 to
1cde2aa
Compare
8642b5c to
9cc8d15
Compare
|
Hi everyone, I wanted to give an update on the current state of the sync functionality and propose a shift in focus for this PR. In the initial testing phases, we used the Without Furthermore, since OpenCloud is heavily aimed at KRITIS/NIS2 companies, placing synced files in a public Proposed Solution:
I have just pushed a commit that removes the public mirror export and updates the wording to reflect this secure, offline-cache approach. Let me know what you think! |
|
Hey guys, so I was looking into how we handle the local offline sync storage and I noticed we have a pretty big architectural choice to make. Right now, we're saving everything into the internal Android storage ( I did some research on how Nextcloud does it, and they actually use What do you guys think? Should we stick with the current ultra-secure approach (which I kinda prefer for our target audience), or should we migrate to the Nextcloud way ( |
As I understand, the option is A or B. And I know that usually, leaving these choices to the user might not be a good idea. But being this such a requested feature (see #24), I believe it could benefit from allowing the admin to set such flag. So, instead of this setting being in the Android device, the admin can flag the server as "Allow Two-Way sync on Android/Mobile Devices", which in turn allows the Android device to make this files available to the user in an insecure manner. For people like me who use OpenCloud only for themselves through tailscale (Not even available online), this would be a massive benefit. By default, OpenCloud would be secure, unless the admin enables this, knowing what it entails. |
|
Hi, i made code changes so it behaves like Nextcloud if u enable the option "Enable file manager access" - which is by default opted out - so we have a balance between security and usability. i removed the bloat from previous codes. Theres no mirroring into a new public folder anymore. I'll look into adding a option to make a real sync like desktop app (so when u create file in the folder in the file manager app, that it gets uploaded). But i am afraid if this is gonna be too complicated - we will see |
82ab5ab to
f60a081
Compare
|
I think i'll close this PR as it is pointless. Android restrictions... the amount of code changes without a significant UX improvement due to Android Restrictions is never getting merged, but it was a nice experiment, thanks to all :) |
What this PR does
This PR adds three major features for offline file management, along with a MIME-type bugfix.
1. Make All Files Available Offline
Adds a "Download Everything" background worker that downloads all server files to the device for offline access. Previously, users had to tap each file individually to make it available offline.
2. Auto-Sync (Automatic Change Detection)
Introduces a background worker that automatically detects local modifications to offline files and syncs them back to the server.
3. File Manager Visibility (Optional)
Adds an "Enable File Manager Access" toggle under Settings → Security. When enabled, offline files are stored in
Android/media/eu.opencloud.android/instead of the app's private internal storage.What this enables:
What this does NOT enable:
Android/media/)Security considerations:
Android/media/are visible to file managers and USB, but cannot be modified or deleted by other regular apps (Android Scoped Storage restrictions apply)MANAGE_EXTERNAL_STORAGEpermission (Play Store compliant)4. MIME-Type Bugfix
Fixes MIME-type detection so that tapping offline files correctly suggests the right external apps (e.g. Collabora Office for .docx, Gallery for images).
How the sync flow works
Settings added