OneDrive Simple Client - It's Not Easy

    Everyone has long known the OneDrive service from Microsoft, which is a cloud-based data warehouse with a good Web UI.

    For similar services, in particular, Dropbox, a huge number of add-ons and extensions have been released, for example, MacDropAny and many others. There are not many extensions for OneDrive, so it has become a platform for us - and we have released an alternative client for OneDrive - syncDriver.



    It has all the functionality of a standard client from Microsoft, and in addition a number of features for which it makes sense to use it. You can install it here . Immediately after installation, he will offer you to connect to the OneDrive service.

    Customization


    After connecting, we can configure the folder for synchronization and modes.
    The modes of the first run are separately highlighted: for example, we can only download the folder structure or nothing at all, and after initialization, any changes will be downloaded.
    Additionally, we can configure selective synchronization filters and synchronization direction. Proxy settings are of course also supported, including authentication.

    Everything, it works ...


    After setting up, it will take some time to download OneDrive metadata and analyze the local file system.
    If the account contains a large amount of data, downloading everything takes some time. To optimize this process, you can configure selective synchronization.
    When synchronization is complete, any changes to the folder will be reflected in the OneDrive account.

    What can


    If you need to add an arbitrary folder to OneDrive from your computer, syncDriver allows you to use symlinks - this is implemented by the Link a folder command (or the Add button on the main form).

    In syncDriver selective synchronization is possible.
    The Selective Sync ... command in the settings window allows you to add / exclude a folder from synchronization: all changes made in it after that will not be sent to OneDrive.

    The option of synchronization direction allows you to synchronize in both one and two directions, while you can only choose to display the changes in OneDrive to the file system without uploading it back to the OneDrive cloud.

    An easy way to access OneDrive is to assign a device letter to the sync folder.

    In the network settings, the proxy server can specify a username and password that the standard client does not know how to. This is very convenient if you use syncDriver in an organization where the Internet is distributed only through a proxy.

    It works on all versions of Windows we know from XP to 8.1, we will still be testing on Windows 10.

    How is done


    To support the client for different OSs, it was decided to use .NET. Fragments specific to different systems (mainly UI and work with services / daemons) are allocated in separate assemblies. The current version contains UI on Windows forms, for versions for other platforms Gtk # is used - but this version has not yet been released in production.
    For logging in the system, we chose NLog - it works quickly and is extremely easy to configure.
    For modular SOA, we have implemented our Framework Context.NET, which is available on github .

    How does it work


    syncDriver consists of two parts: service and client (UI). They communicate through json packets sent over a network connection.
    In addition, all service settings are described in the .config file, which is configured from the client UI.
    Client synchronization is designed to isolate the local file system from the file system in the cloud. Each of the file systems is implemented as an abstraction that solves the problems of monitoring, indexing and applying changes independently. This means that the OneDrive level knows nothing about the local file system and vice versa.

    The entire synchronization process takes place according to the following scenario:
    - each file system conducts full indexing of the resource and saves it to a local database
    - the file system is responsible for detecting changes and forwarding the message to the queue
    - messages in the queue are processed in a strict order, except in special cases, which we will consider later
    - in case of an error, we wait for the completion of all parallel operations and execute it again. If the error occurs again, it is recorded and issued on the UI.

    The local file system monitors changes through FileSystemWatcher. In addition, there is a complete tree traversal with a certain interval, this guarantees us the catch of changes made when the client was not started.

    Getting the OneDrive file system tree is implemented through several APIs that give us information about what changed when comparing with the local database.

    A key aspect of synchronization is the fact that during the synchronization process two file systems are not compared, and the file system is compared with its previous version from the database, this gives us the ability to synchronize in one direction.

    In a separate way, renaming and moving are handled in the synchronization queue. If, for example, we created a folder with a large number of files, and then renamed it, then the renaming occurs first, and all messages in the queue are renamed accordingly, that is, we upload files already to the renamed or moved folder.
    In the event of a conflicting file change, an additional copy of the file is formed on both sides with the suffix (1), (2), etc., automatic conflict resolution may be an option for future versions.

    Problems


    Most of the problems were associated with the processing of events from the file system:
    - when copying a large file, we get a large number of events, each of which needs to be double-checked whether the copying process has ended or not.
    - when saving a file, a number of applications create a temporary file, and then rename it to the destination file.
    - when you try to rotate the image directly in Windows Explorer, a series of events occurs: creating a new temporary file, replacing the previous one, deleting the temporary one (differs from the previous paragraph in that the temporary file is not renamed, but copied).

    To date, most of the problems have been resolved, and the version has been pretty stable since switching to OneDrive with SkyDrive.

    What for


    Our goal was to offer you an easy, stable version of the client for a well-known service from MS. Moreover, we plan to release a portable version of our product.
    In parallel, we are developing a version for Linux.
    But why?
    Now users come to us to solve the following problems (in order of priority):
    - Work under Windows 8.1 with a local account
    - Work under Windows XP
    - Use symlinks
    - Use network drives
    - Work through a proxy with authorization
    and a number of other features.

    And most of all we would like to hear in the comments which features are most interesting to you.

    Also popular now: