xdg-desktop-portal icon indicating copy to clipboard operation
xdg-desktop-portal copied to clipboard

NetworkMonitor portal reports outdated information

Open sophie-h opened this issue 3 years ago • 5 comments

The output of NetworkManager and NetworkMonitor portal on D-Bus do not agree. Example with the "metered" status:

NetworkManager

dbus-send --print-reply --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.DBus.Properties.Get string:org.freedesktop.NetworkManager string:Metered
method return time=1635802984.480751 sender=:1.9 -> destination=:1.753 serial=9543 reply_serial=2
   variant       uint32 1

Meaning of output value

nm_metered_to_bool (guint nm_metered)
{
  switch (nm_metered)
    {
      case 1: /* yes */
      case 3: /* guess-yes */
        return TRUE;

NetworkMonitor Portal

dbus-send --print-reply --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.NetworkMonitor.GetMetered
method return time=1635803126.973979 sender=:1.95 -> destination=:1.1453 serial=2973 reply_serial=2
   boolean false

The same applies to the other properties.

Killing all xdg-desktop-portal instances leads to correct responses on the next request.

sophie-h avatar Nov 11 '21 22:11 sophie-h

Pretty sure that's a duplicate of problems with apps not listening to the property changing afterwards...

hadess avatar Nov 11 '21 23:11 hadess

Here you go: https://gitlab.gnome.org/GNOME/glib/issues/1718

hadess avatar Nov 11 '21 23:11 hadess

How is the gio API relevant to my manual dbus call?

sophie-h avatar Nov 12 '21 13:11 sophie-h

How is the gio API relevant to my manual dbus call?

The behaviour of the GIO API is caused by the behaviour of the portal.

hadess avatar Nov 12 '21 14:11 hadess

I still don't understand what you mean but I am guessing your idea is that the problem just goes away when listening to signals? That's a recording of what happens in that case (left without flatpak, right with flatpak)

https://user-images.githubusercontent.com/3466497/144310541-0f301641-27a0-427f-b420-c181c108db54.mp4

sophie-h avatar Dec 01 '21 20:12 sophie-h