Skip to content
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

Enhance offline sync job #3542

Open
tobiasKaminsky opened this issue Feb 1, 2019 · 6 comments
Open

Enhance offline sync job #3542

tobiasKaminsky opened this issue Feb 1, 2019 · 6 comments
Labels
enhancement feature: sync and upload Syncing or uploading (that isn't auto upload specific)

Comments

@tobiasKaminsky
Copy link
Member

With next version (3.5.0) we will check every 15 min and if on wifi, we update each downloaded file.
This is rather easy as we can detect it via changed eTag.

Locally changed files are currently "ignored", as they should either bei directly uploaded/changed in our app or via doc provider (and thus the changes are also instant).

However, we should think how to improve this, so that a downloaded file get updated, if it is changed locally, without notice of our app.
This should happen during the same offline sync job.

@nextcloud/desktop how do you detect these changes? Via inotify and handle them directly?
For each downloaded file I could compare the server info (which is unchanged as no etag changed) with the current state of the locally saved file:

  • size -> might not change
  • modificationTimestamp -> might have issues with timezones…
  • (hashSum) -> we do not have this right now

Any other ideas?

Maybe modificationTimestamp is enough. If this differs, we try to synchronize the file. Worst case if we had a timezone change is, that all downloaded files tries to sync, but nothing really changes.

@nextcloud-android-bot
Copy link
Collaborator

GitMate.io thinks possibly related issues are #285 ([TOP] Enhance sync folders), #668 (Folder sync), #1898 (syncing problem), #2886 (Sync downloaded), and #1008 (Improve offline support).

@tobiasKaminsky
Copy link
Member Author

Mario pointed out that we already have crc32 as checksum, so we could use this.

@tobiasKaminsky
Copy link
Member Author

As discussed on irc: first check for changed mod timestamp, then verifiy via crc.

@mario
Copy link
Contributor

mario commented Feb 1, 2019

So this is basically what we already do for auto upload - since timestamp changes quite often (well, more often than I'd like), it makes sense to use crc to validate the changes. Collisions are bound to happen, sure, but it's a significantly lighter alternative to other algos and yet good enough.

@rullzer
Copy link
Member

rullzer commented Feb 6, 2019

Timestamp, size, checksum

However I'd go for md5 or sha1 or something instead of crc. On modern hardware this should be trivial to handle if you have to read the whole file anyway.

@PVince81
Copy link
Member

Not sure if it's supposed working: in my setup the upload after local changes doesn't even work when online.

I'm using QuickEdit to edit a text file which I marked as "Download". After saving the file and closing the editor, no syncing happens. I always have to tap "Synchronize" on that specific file manually for it to upload.

I've seen various tickets about this but am unsure if online auto-sync when changed is currently supported or not.

@joshtrichards joshtrichards added the feature: sync and upload Syncing or uploading (that isn't auto upload specific) label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature: sync and upload Syncing or uploading (that isn't auto upload specific)
Projects
None yet
Development

No branches or pull requests

6 participants