After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709835 - Wrong unique name shown for every well-known name
Wrong unique name shown for every well-known name
Status: RESOLVED FIXED
Product: d-feet
Classification: Other
Component: general
0.3.x
Other Linux
: Normal normal
: ---
Assigned To: D-Feet Maintainer(s)
D-Feet Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-10-10 16:38 UTC by Aleksander Morgado
Modified: 2013-10-19 06:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch. (6.44 KB, patch)
2013-10-10 17:22 UTC, Aleksander Morgado
none Details | Review
Updated patch. (7.27 KB, patch)
2013-10-16 07:09 UTC, Aleksander Morgado
none Details | Review

Description Aleksander Morgado 2013-10-10 16:38:29 UTC
d-feet will try to show both the well-known name ("Name" field) and the unique name ("Unique name" field) in the introspection window.

But, the unique name being shown for every well-known name is the same. It's actually the unique name of the d-feet connection to the bus, not the unique-name of the actual service in the bus:

In introspection.py:245,
  self.__label_unique_name.set_text(self.connection.get_unique_name())

Note also that ListNames() in org.freedesktop.DBus seems to return all unique names and all well-known names at the same time. This is, every service with a well-known name will be listed twice: one with the well-known name and another time with the unique name.

The fix would probably involve:
 1) Run ListNames() and use treat only the well-known names, calling GetNameOwner() for each in org.freedesktop.DBus, which should give the unique name of each service.
 2) Run ListNames() again, this time looking only at the unique names, and skip adding those which were already added in the previous step.
Comment 1 Aleksander Morgado 2013-10-10 17:21:18 UTC
> Note also that ListNames() in org.freedesktop.DBus seems to return all unique
> names and all well-known names at the same time. This is, every service with a
> well-known name will be listed twice: one with the well-known name and another
> time with the unique name.
> 
> The fix would probably involve:
>  1) Run ListNames() and use treat only the well-known names, calling
> GetNameOwner() for each in org.freedesktop.DBus, which should give the unique
> name of each service.
>  2) Run ListNames() again, this time looking only at the unique names, and skip
> adding those which were already added in the previous step.

Forget about this part; this is an artifact of another issue, as far as I can see.
Comment 2 Aleksander Morgado 2013-10-10 17:22:42 UTC
Created attachment 256934 [details] [review]
Patch.

(In reply to comment #0)
> d-feet will try to show both the well-known name ("Name" field) and the unique
> name ("Unique name" field) in the introspection window.
> 
> But, the unique name being shown for every well-known name is the same. It's
> actually the unique name of the d-feet connection to the bus, not the
> unique-name of the actual service in the bus:
> 
> In introspection.py:245,
>   self.__label_unique_name.set_text(self.connection.get_unique_name())
> 

This patch should fix the unique name shown.
Comment 3 Thomas Bechtold 2013-10-15 17:32:54 UTC
(In reply to comment #2)
> Created an attachment (id=256934) [details] [review]
> Patch.
> 
> (In reply to comment #0)
> > d-feet will try to show both the well-known name ("Name" field) and the unique
> > name ("Unique name" field) in the introspection window.
> > 
> > But, the unique name being shown for every well-known name is the same. It's
> > actually the unique name of the d-feet connection to the bus, not the
> > unique-name of the actual service in the bus:
> > 
> > In introspection.py:245,
> >   self.__label_unique_name.set_text(self.connection.get_unique_name())
> > 
> 
> This patch should fix the unique name shown.

Patch looks good to me, but the tests fail. try "make check"
Comment 4 Aleksander Morgado 2013-10-16 07:09:44 UTC
Created attachment 257397 [details] [review]
Updated patch.

Yeah, forgot make check because I compiled with --disable-tests :)

Done now, let me know what you think.
Comment 5 Thomas Bechtold 2013-10-17 06:05:28 UTC
(In reply to comment #4)
> Created an attachment (id=257397) [details] [review]
> Updated patch.
> 
> Yeah, forgot make check because I compiled with --disable-tests :)
> 
> Done now, let me know what you think.

make check works fine now. But when I exit the program, I get now:

tom@steinpilz:~/devel/gnome/src/d-feet$ DFEET_DEBUG=1 ./src/d-feet
Traceback (most recent call last):
  • File "/home/tom/devel/gnome/src/d-feet/src/dfeet/window.py", line 124 in __on_destroy
    self.stack.disconnect(self.__stack_child_added_id)
  • File "/home/tom/devel/gnome/build/lib/python2.7/site-packages/gi/overrides/GObject.py", line 429 in wrapper
    return func(_get_instance_for_signal(obj), *args, **kwargs)
  • File "/home/tom/devel/gnome/build/lib/python2.7/site-packages/gi/types.py", line 113 in function
    return info.invoke(*args, **kwargs)
TypeError: argument instance: Expected GObject.Object, but got PyCapsule
Segmentation fault

Maybe that's a bug in pygobject?
Comment 6 Aleksander Morgado 2013-10-17 07:03:01 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=257397) [details] [review] [details] [review]
> > Updated patch.
> > 
> > Yeah, forgot make check because I compiled with --disable-tests :)
> > 
> > Done now, let me know what you think.
> 
> make check works fine now. But when I exit the program, I get now:
> 
> tom@steinpilz:~/devel/gnome/src/d-feet$ DFEET_DEBUG=1 ./src/d-feet
> Traceback (most recent call last):
> 

I have no idea what that is. Do you only get that when my patches are running?
Comment 7 Thomas Bechtold 2013-10-17 18:50:29 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > Created an attachment (id=257397) [details] [review] [details] [review] [details] [review]
> > > Updated patch.
> > > 
> > > Yeah, forgot make check because I compiled with --disable-tests :)
> > > 
> > > Done now, let me know what you think.
> > 
> > make check works fine now. But when I exit the program, I get now:
> > 
> > tom@steinpilz:~/devel/gnome/src/d-feet$ DFEET_DEBUG=1 ./src/d-feet
> > Traceback (most recent call last):
> > 
> 
> I have no idea what that is. Do you only get that when my patches are running?

No. Checked and I get the same error without our patches. So I'll push them. Thanks!!!