DBus error calling GNetworkManager.can_reach under Flatpak
It seems that Geary currently assumes that a failure to detect network connectivity means that connections will fail. This is not true in general - for example, when the site used for connectivity checking is down (or the current network mis-routes it) but connections to the mail server would succeed.
In general, the only way to really know if you can connect to the mail server is to try to connect to the mail server and see if it succeeds. NetworkManager saying “we have internet access” is not a guarantee that connections will succeed, nor is NetworkManager saying “we don't have internet access” a guarantee that connections will fail.
Monitoring the connection status can be useful for when network connectivity changes - ie: we weren't connected, now we are, so start checking for mail - but it shouldn't block attempting to connect at all. (Additionally, it shouldn't override manual user attempts to check mail, but Geary doesn't [currently?] have a button for that).
This bug report is triggered by the fact that when using the gnome-apps-nightly flatpak on Ubuntu Cosmic, Geary fails to check or send mail, but is not limited to it - weird network connectivity has prevented Geary from working for me in the past, just transiently.
Geary version: master~g8cf7bf9
GTK version: 3.23.3
Desktop: ubuntu:GNOME
Problem type: GEARY_PROBLEM_TYPE_CONNECTION_ERROR
Account type: OTHER
Service type: GEARY_PROTOCOL_IMAP
Endpoint: mail.cooperteam.net/default:143
Error type: GDbusError 19
Message: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “CanReach”
Back trace:
- _init
- _init
- _init
- g_closure_invoke
- g_signal_handler_disconnect
- g_signal_emit_valist
- g_signal_emit
- _init
- g_closure_invoke
- g_signal_handler_disconnect
- g_signal_emit_valist
- g_signal_emit
- _init
- g_simple_proxy_resolver_set_uri_proxy
- g_task_attach_source
- g_unix_output_stream_get_close_fd
- g_simple_proxy_resolver_set_uri_proxy
- g_task_attach_source
- g_bus_unwatch_name
- g_simple_proxy_resolver_set_uri_proxy
- g_task_attach_source
- g_dbus_connection_send_message_with_reply_finish
- g_simple_proxy_resolver_set_uri_proxy
- g_simple_proxy_resolver_set_uri_proxy
- g_main_context_dispatch
- g_main_context_dispatch
- g_main_context_iteration
- g_application_run
- _init
- __libc_start_main
- _init