-
Notifications
You must be signed in to change notification settings - Fork 276
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
Inconsistency in camera upload sync #301
Comments
As a temporary fix you could check if you can enable timestamps for files names in your camera settings. Technically there is a problem with the FileObserver (honestly I'm not 100% sure if one is used - if not it imho should be used) or the methods handling the events. |
This is the reason why it does |
Seafile could use FileObserver to also delete files when they are deleted and upload files on modify and on create. In addition if that shouldn't be done seafile could honor last modification time / creation time. |
@Logan676 It's clear why the issue happens - but it's unexpected behavior and will cause loss of trust. It's common for users of mobile phones to delete camera photos - and if those photos had been automatically backed up using Seadroid the new photos taken (filling up the holes in the naming scheme) will never be backed up/uploaded. Since the user hasn't taken an action where they could expect such behavior there should be no need for them to perform manual workarounds. Checking vs last modification/creation time in addition to the name in the database entry would work fine as a solution. |
Thanks for your comment, will add this feature soon. |
Add for the next release ? |
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
This patch reworks most of the camera upload. It contains two important changes: (1) The old code implemented camera upload as a service. While that worked, it proved somewhat problematic. Services can be killed by Android, and the service had to be started by an Activity. Android provides an API for implementing data syncing: https://developer.android.com/training/sync-adapters/index.html This API provides a number of advantages compared to a self-implemented service. Among them are: * Less code * Automatic error recovery (e.g. retry on network errors) * Periodic synchronisation (e.g. every 24h) * Better visibility to the user (via Android Settings->Accounts) (2) The old camera media sync algortihm tried to upload media via two ways: a) when a new photo was added to the MediaStore, that photo was uploaded. But *only* if the data plan allowed it. b) when the user interacts with Seadroid, the service uploaded all photos not yet uploaded. It did that by scanning certain hard-coded directories on the externalStorage and looking for new media files. Important changes added by this patch: - This new design builds soly on the MediaStore. The MediaStore contains all images/videos on the phone. Therefore it should not be necessary to scan (or even be aware of) where the photos are actually stored. - The MediaStore has a column where it records the "DATA_ADDED" for every media file. We can use that to sort and filter for new newly added media files. This eases up the syncing mechanism considerably. - Allowing to sync to sub directories in a repository. - There is still a service necessary to monitor MediaStore activity. However even without that service, Android will perform a sync about every 24h. Also that service is now autostarted on System boot and on Seadroid apk upgrades. - Finally merging with existing files on the server was also improved by skipping files that are already present on the server (it compares the file size and will still upload if the sizes differ. That's probably the best one can do with the current API2). Overall, this patch should adresses the following issues: issue haiwen#277 (Camera upload function dumps all subdir files into single dir) issue haiwen#301 (Inconsistency in camera upload sync) issue haiwen#311 (second suggestion: target repo sub directories) issue haiwen#336 (file duplication when doing a full resync) issue haiwen#375 (Picture upload not acting as service?) issue haiwen#423 (Pictures never upload) [maybe. not sure what's going on there] Useful links: https://developer.android.com/training/sync-adapters/creating-sync-adapter.html http://blog.udinic.com/2013/07/24/write-your-own-android-sync-adapter/
The following is valid for a Sony Xperia Z3 Compact. I don't know if it's valid for all Androids.
This is unexpected behavior and might cause users to believe their photos are backed up when they aren't. If filename are used to know what to sync then maybe hashes of content might be needed instead.
The text was updated successfully, but these errors were encountered: