[tomboy] Always attempt to check server for updates, to catch connection issues



commit ff351783c75473469a5159f7f49c74e21b8c4f86
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Mon Mar 8 06:37:06 2010 -0800

    Always attempt to check server for updates, to catch connection issues
    
    Previously, autosync would try to conserve requests by not checking the
    server if the client indicated that a sync was needed. But since performing
    sync disables the note window, this was a fruitless irritation.

 Tomboy/Synchronization/SyncManager.cs |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/Tomboy/Synchronization/SyncManager.cs b/Tomboy/Synchronization/SyncManager.cs
index efc3d32..a8c2ec3 100644
--- a/Tomboy/Synchronization/SyncManager.cs
+++ b/Tomboy/Synchronization/SyncManager.cs
@@ -249,12 +249,18 @@ namespace Tomboy.Sync
 						}
 					}
 				}
-				// Wasteful to check when we'll sync anyway
-				// TODO: Unless we want to show a bubble when server has updates for users that don't autosync
-				if (!clientHasUpdates) {
-					Logger.Debug ("BackgroundSyncChecker: No client updates; checking with server");
+
+				// NOTE: Important to check, at least to verify
+				//       that server is available
+				try {
+					Logger.Debug ("BackgroundSyncChecker: Checking server for updates");
 					serverHasUpdates = server.UpdatesAvailableSince (client.LastSynchronizedRevision);
+				} catch {
+					// TODO: A libnotify bubble might be nice
+					Logger.Debug ("BackgroundSyncChecker: Error connecting to server");
+					return;
 				}
+
 				addin.PostSyncCleanup (); // Let FUSE unmount, etc
 
 				if (clientHasUpdates || serverHasUpdates) {



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