Skip to content

Automated synchronization of folders (scope: inside 'owncloud' folder) #1136

Closed

Description

@MTRichards

As an ownCloud user, I want to be able to sync a folder from my Android mobile device to the server so that I can access and edit files easily across devices without thinking about it

Acceptance Criteria:

  • Two-way syncing, from the folder set, to all its descendants
  • For folders existing in an OC account (syncing local folders only existing in the device is out of the scope of this issue).
  • The current Favorites star is to be renamed Sync "Available offline"
  • The Sync star icon is to be replaced with a circular static sync icon an arrow pointing downwards, place over an horizontal line; see more about icons in As an OC user I want clear badges in my list of files so that they are easy to understand #1218
  • Sync icon is to be the same color as the star and found in the same location on the iOS device (yellow) (iOS)
  • Sync icon will automatically replace existing favorite directories on files currently set as favorites
  • Sync for iOS can only occur when the app is open, as there is no service mechanism for initiating sync in the background. As a result, every time the app is opened, the local cache is refreshed, and any new files are synced with the server. (iOS)
  • Once the app is opened, sync of individual directories happens when the user navigates into the directory
  • When a user is browsing files and pulls down to refresh the directory, any files and folders in that directory are synced automatically (including folder children).
  • When a directory is syncing, if the appany folder is blocked, a circular icon shows that the app the folder is working on the sync

@davivel updated after May 16 Design Days


edited by @jabarros

  • Create 'available_offline_folders' branch from master in android repository @jabarros
  • [DEV] Allow set a folder as favorite (menu) @jabarros
  • [DEV] Save the favorite folder state on db and unset as favorite all children files that were favorites @jabarros
  • [DEV] Modify places where favorite folders are being syncing to sync also folders when file is folder: Case of folders syncing (pull down or enter in) @jabarros
  • [DEV] Modify places where favorite folders are being synced to sync also folders when file is folder: Case of full account sync and refresh account (in menu) @jabarros
  • [DEV] Check service that observes changes (FileObserveService) to take into account changes inside sync folders @malkomich
  • [DEV] Get folder data correctly, to assure a favorite keeps being favorite while a refresh operation is done @malkomich
  • [DEV] Create method to check if file is favorite or belongs to a favorite folder @jabarros
  • [DEV] Check on unfavorite request if the file is favorite by inheritance or not to allow execute the operation @malkomich
  • [DEV] Avoid change the 'favorite' value when syncying and only be able to set value since file item menu interaction @jabarros

SET / UNSET AVAILABLE OFFLINE PROPERTY

  • Review propagation of 'Unset as available offline' while browsing the file tree, not all the children files unset.

SYNC CONTENT ON OBSERVED CHANGE -> FileObserverService & friends

  • Back to a single class for observe available offline files

  • Extend FolderObserver to observe any file it contains, or selected files added one by one

  • Remove individual observers when ancestor folder is added to be observed.

  • Observe updates of files in subfolders created after a folder was set as available offline.

  • Check update of observer service when av-off file/folder is renamed

  • Check update of observer service when file in av-off folder is renamed

  • Check update of observer service when folder in av-off folder is renamed

  • Check update of observer service when av-off file/folder is moved to non-av folder

  • Check update of observer service when av-off file/folder is moved into av-off folder

  • Check update of observer service when file/folder is moved out of av-off folder

  • Check update of observer service when file/folder is moved into av-off folder

  • Check update of observer service when file/folder is moved from av-off folder to other av-off folder

  • Grant that av-off property of files sync'ed is NOT modified.

SYNC CONTENT ON POLLED CHANGE -> RefreshFolderOperation & friends

  • Review calls to getAvailableOfflineStatus(...).
  • Review performance to check server updates, while granting local updates.
  • Grant that av-off property of files sync'ed is NOT modified.
  • Refactoring: RefreshFolderOperation and SyncFolderOperation duplicate too much code. [WONT]
  • Refactoring: merge sync services (tentative). [WONT]

OTHER STUFF

  • Changes after CR @jabarros @davivel (WIP)
  • [QA] Create 'available_offline' branch in QA Repo @jesmrec
  • [QA] Merge 'available_offline' branch in QA Repo @jesmrec
  • [QA] Create test plan @jesmrec
  • [QA] Validate test plan @jesmrec
  • Merge 'available_offline_folders' branch into master

BUGS & IMPROVEMENTS

Activity

  1. Kernald commented on Sep 8, 2015

    @Kernald
    Contributor

    Related standard material design icon here.

  2. rperezb commented on Oct 21, 2015

    @rperezb

    @jancborchardt we'd appreciate your input as well as @tobiasKaminsky @AndyScherzinger @LukeOwncloud and others.

    The key thing is about the icon, does this icon represent that the files or folders are kept-up-to-date?
    (The same one will be used on iOS too)

    cc/
    @davivel @masensio @javiergonzper @ggdiez @nasli @jesmrec

  3. AndyScherzinger commented on Oct 21, 2015

    @AndyScherzinger
    Contributor

    Tricky one.

    • The sync icon is imho rather an action(-trigger) than a state
    • The star is used by others (e.g. Dropbox) for this matter but is also used to highlight/bookmark (e.g. gmail)

    So I would keep the star for keep-in-sync since

    • I guess the sync icon is not as bold style/pixel-wise and thus harder to read on a white background
    • the sync icon might (at least by me without any explanation) be interpreted as a sync is running on these folder(s)

    Just a personal opinion thought!

  4. rperezb commented on Oct 21, 2015

    @rperezb

    Thanks for the answer.

    The reason for changing the star is because on the ownCloud web interface it means bookmark, so it´s confusing that on the mobile apps it has a different meaning.

    We agree that the sync icon may be understood as an action icos, because of that we are looking for ideas

  5. jancborchardt commented on Oct 21, 2015

    @jancborchardt
    Contributor

    Right, good point by @AndyScherzinger:

    the sync icon might (at least by me without any explanation) be interpreted as a sync is running on these folder(s)

    Sure in the web interface the star means favoriting, but in the desktop app the circular sync arrows mean that a sync is running and the file isn’t synced yet. Exactly the opposite of what this would do.

  6. tobiasKaminsky commented on Oct 21, 2015

    @tobiasKaminsky
    Contributor

    According to "accounts" in android setting a static circular symbol means, that a sync is possible (and started by clicking on it) and a spinning symbol means that a sync is in progress.
    Maybe this will also work for us?

  7. jancborchardt commented on Oct 21, 2015

    @jancborchardt
    Contributor

    Our design language (and that of Dropbox and other players of course) uses the circular arrow as »file about to be synced« though. @owncloud/designers any ideas? We could use a new »pinned« metaphor like Google Drive does …

  8. davivel commented on Oct 22, 2015

    @davivel
    Contributor

    the sync icon might (at least by me without any explanation) be interpreted as a sync is running on these folder(s)

    Totally agree.

    How about adding a new overlay icon (top left, e.g.) using the default icons?

    I don't think we need a third overlay icon. I'd use two, as right now: one to show the current sync state of the file (sync'ing, downloading, uploading, synced/down, ...) , and the other to show how the user wants that it's sync'ed (kept-in-sync or 'regular'). Let me open a separate issue to discuss about the icon(s), I think it's important they are well balanced.

    @LukeOwncloud , about your doubts:
    (5) Yes, two-way-sync.
    (6,7). The rule is "sync the contents of all the kept-in-sync files in the current (visible) folder" ; to allow folders to be kept-in-sync, we need to define the content of a folder; let it be all the contents of its descendents .
    When the app is started, the current folder is root. If a folder in the second level of depth is set to be kept-in-sync, it will not be sync'ed just opening the app.
    The difference between (6) and (7) is the event triggering the synchronization. But the synchronization is the same.

  9. davivel commented on Oct 27, 2015

    @davivel
    Contributor

    Sorry for the delay. I opened #1218 to discuss the details about the icon.

  10. helmo commented on May 2, 2016

    @helmo

    I noticed that the bounty on #3 - https://www.bountysource.com/issues/541847-two-way-file-sync-for-specific-folders-or-files/backers is still open.
    Should we try to get it moved here?

    I tried testing this using the current beta and found that when I edit a file on android that was downloaded via owncloud it uploads the changed file. But a new file created under an existing directory downloaded by owncloud is not uploaded.

  11. 41 remaining items

  12. jesmrec commented on Nov 16, 2016

    @jesmrec
    Member

    Bug

    Steps

    1. Set a folder as av offline
    2. When it is fully synced, without removing the selection, unset it as av offline

    Current behaviour

    In toolbar/menu, is displayed the "Unset as av. offline" option

    Expected behaviour

    In toolbar/menu, is displayed the "Set as av. offline" option

    Tested with Nexus9 v6

    Server 9.1.2.

  13. jesmrec commented on Nov 16, 2016

    @jesmrec
    Member

    Bug

    Steps

    1. Login in a redirect server
    2. Set a folder as av. offline
    3. Try to sync the folder, or refresh manually

    Current behaviour

    Message Synchronization of folder could not be completed

    Actual behaviour

    Folder is tried to be synced with no errors

    Tested with Galaxy Note 4 v6, Galaxy Nexus 9 v6

    Server 8.2.2

  14. davivel commented on Nov 16, 2016

    @davivel
    Contributor

    So, the point is if the cancellation also removes the "av. offline" condition or not. IMHO, if the user cancels the sync process is because he does not want this folder to be synced. If the cancelled folder is in the root, when the user browses, switches the account and back, closes the app and reopens it... this folder starts again to sync. The "stop sync" status (av offline folder but not synced due to the cancelling) seems to be difficult to stay, so you can not perform (almost) any action if you want to prevent the synchronization.

    How does this work in iOS? cc @nasli

    EDITED: besides, if the user really does not want the folder to be synced, can't we expect that she unsets the folder as available offline right after cancelling the synchronization? What would be a real use case of this? "I set up the wrong folder as available offline and I want to fix it before all the folder tree is sync'ed?"

  15. jesmrec commented on Nov 16, 2016

    @jesmrec
    Member

    @davivel in iOS you can cancel the process and the folder becomes not av. offline.

    EDITED: besides, if the user really does not want the folder to be synced, can't we expect that she unsets the folder as available offline right after cancelling the synchronization? What would be a real use case of this? "I set up the wrong folder as available offline and I want to fix it before all the folder tree is sync'ed?"

    unsetting the folder as av. offline after cancelling is another valid possibility, that cover the real case you mentioned as well.

    The real case i was thinking about is this one:

    1. I set a folder as av. offline
    2. I cancel the process (whatever the reason, i don't want the folder synced right now. But later, i want it synced)

    From that moment:

    • If i close the app and open it again -> the folder will sync automatically
    • If i browse through the parent folder -> the folder will sync automatically
    • If i switch to another account and then, switch the the folder's account again -> the folder will sync automatically (in this case, only if the av. offline folder is in root)
    • If i have the account synced in device settings -> the folder will sync automatically

    I mean, if you set a folder as av. offline but you don't sync it (by cancelling and staying it as av. offline), it's very probably that this folder will sync in a short time itself. If you cancelled, perhaps you don't want that.

    If the solution is unsetting as av. offline using the menu option, we can take advantage and do it automatically, if it is possible.

    More thoughts are welcome, @nasli @rperezb

  16. davivel commented on Nov 25, 2016

    @davivel
    Contributor

    As agreed offline: let's replace in the action bar the action 'cancel' with 'unset as available offline', making it also cancels the synchronization if it's in progress.

  17. davivel commented on Dec 2, 2016

    @davivel
    Contributor

    Extra BUG discovered while fixing "the last one" :

    1. Set a folder as available offline in the device; the folder should have a tree with at least 2 levels of extra depth inside.
    2. In web UI, add a new file deep down the tree of the available offline folder.
    3. Refresh the parent folder of the available offline folder.

    EXPECTED BEHAVIOUR

    1. The new file is downloaded automatically

    CURRENT BEHAVIOUR

    1. The new file is not downloaded (logs show that it's discovered, but not downloaded in the same moment).
  18. davivel commented on Dec 5, 2016

    @davivel
    Contributor

    @jesmrec , as said offline, all known bugs are ready to be tested.

  19. jesmrec commented on Dec 7, 2016

    @jesmrec
    Member

    @davivel

    Related to #1136 (comment)

    The problem is fixed (the upload is not retried forever), but right now, it appears twice in the uploads view. Could it be prevented? (only one appearance on the failed upload)

  20. davivel commented on Dec 7, 2016

    @davivel
    Contributor

    I'll review it, though I might need your help to reproduce it.

  21. jesmrec commented on Dec 7, 2016

    @jesmrec
    Member

    Sure!

    Edit: this bug happens whether you force the upload by tapping on the file without permissions. This behaviour is not wrong (although can be improved) but is out of scope here.

  22. jesmrec commented on Dec 7, 2016

    @jesmrec
    Member

    Approved

    Nice feature already available!!! great job @davivel :)

  23. davivel commented on Dec 12, 2016

    @davivel
    Contributor

    Really to go with next release.

    Congrats, team.

  24. twixi commented on Feb 19, 2017

    @twixi

    Very need full sync from Server to phone and vice versa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions