[evolution-activesync/for-master/folder-sync-hack: 2/3] eas-daemon: workround folder sync when server loses state



commit bae5de603d7fd7c082cefe63e1aad91613e16fae
Author: Graham R. Cobb <g+syncevolution cobb uk net>
Date:   Tue Mar 5 17:42:55 2013 +0000

    eas-daemon: workround folder sync when server loses state
    
    This is a hack to workround the problem that the ActiveSync server can lose
    state and demand that we restart the folder sync with key 0.  The hack is to
    **always** do every folder sync starting from key 0.  Of course, this means
    that if there are large numbers of folders or changes are rare then extra data
    has to be communicated.
    
    A more subtle fix would be to only reset the sync if the server complains about
    an invalid sync key.  That could be considered for a future update.

 eas-daemon/src/eas-common.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/eas-daemon/src/eas-common.c b/eas-daemon/src/eas-common.c
index 9e464e1..7b5ef11 100644
--- a/eas-daemon/src/eas-common.c
+++ b/eas-daemon/src/eas-common.c
@@ -349,6 +349,15 @@ eas_common_get_folders (EasCommon* self,
                state->context = context;
                state->cnc = connection;
 
+               /* To workround problems when the ActiveSync server loses state, we
+                  always force a full sync of the folder list */
+               eas_connection_forget_folders(connection, &error);
+               if (error) {
+                       g_free (state);
+                       goto err;
+               }
+               sync_key = eas_connection_get_folder_sync_key (connection);
+
                req = eas_sync_folder_hierarchy_req_new (sync_key, account_uid, context);
 
                eas_sync_folder_hierarchy_req_set_results_fn (req, eas_common_update_folders,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]