[geary/mjog/741-inbox-getting-closed] Geary.Util.ConnectivityManager: Fix a spurious connectivity error report



commit a51dc03edfd4ef197d4fc8c1fdc1eff7ea6e6f3d
Author: Michael Gratton <mike vee net>
Date:   Sat Apr 11 12:46:53 2020 +1000

    Geary.Util.ConnectivityManager: Fix a spurious connectivity error report
    
    When a general error occurs checking connectivity of a remote server,
    only treat it as an error if GNetworkMonitor indicates the network is
    available (i.e. that a default route exists). If there is no network,
    it's not surprising that the error occurred.
    
    This fixes a spurious error when the delayed check runs but the host
    is offline.

 src/engine/util/util-connectivity-manager.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/engine/util/util-connectivity-manager.vala b/src/engine/util/util-connectivity-manager.vala
index 9dc0f068..109d14eb 100644
--- a/src/engine/util/util-connectivity-manager.vala
+++ b/src/engine/util/util-connectivity-manager.vala
@@ -166,7 +166,7 @@ public class Geary.ConnectivityManager : BaseObject {
                 // needlessly hassle the user with expected error
                 // messages.
                 GLib.NetworkConnectivity connectivity = this.monitor.connectivity;
-                if (connectivity == FULL ||
+                if ((this.monitor.network_available && connectivity == FULL) ||
                     (connectivity == LOCAL && is_local_address())) {
                     debug("Error checking %s [%s] reachable, treating unreachable: %s",
                           endpoint, connectivity.to_string(), err.message);


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