[geary/wip/98-connectivity-can-reach-debus-error] Handle DBus errors checking for network connectivity.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/98-connectivity-can-reach-debus-error] Handle DBus errors checking for network connectivity.
- Date: Wed, 12 Sep 2018 11:55:39 +0000 (UTC)
commit 29fd8b8af112f6312d88113765ac17b0bad2ee61
Author: Michael Gratton <mike vee net>
Date: Wed Sep 5 09:08:40 2018 +1000
Handle DBus errors checking for network connectivity.
NetworkMonitor.can_reach may throw a DBus error if there is a
problem talking to the portal under Flatpak. We should at least
attempt to connect in this case.
Workaround for issue #97, see also #82
src/engine/util/util-connectivity-manager.vala | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/util/util-connectivity-manager.vala b/src/engine/util/util-connectivity-manager.vala
index f9f77d77..353da649 100644
--- a/src/engine/util/util-connectivity-manager.vala
+++ b/src/engine/util/util-connectivity-manager.vala
@@ -132,8 +132,16 @@ public class Geary.ConnectivityManager : BaseObject {
// as effectively being unreachable, but don't go
// invalid.
debug("Ignoring: %s", err.message);
+ } else if (err is GLib.DBusError &&
+ this.monitor.network_available) {
+ // Work around error cause by NetworkMonitor.can_reach
+ // portal implementation problems under Flatpak. See
+ // Issue #97 and #82 and xdg-desktop-portal #208.
+ debug("DBus error checking %s reachable, treating as reachable: %s",
+ endpoint, err.message);
+ is_reachable = true;
} else if (!(err is IOError.CANCELLED)) {
- debug("Error checking %s reachable, treating as unreachable: %s",
+ debug("Error checking %s reachable, treating as unreachable: %s",
endpoint, err.message);
set_invalid();
address_error_reported(err);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]