From a4f0627f408f9b04d340fa95d27f2929b730847f Mon Sep 17 00:00:00 2001 From: "Graham R. Cobb" Date: Tue, 5 Mar 2013 17:42:55 +0000 Subject: [PATCH] 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 file changed, 9 insertions(+) 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, -- 1.7.10.4