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 732142 - add_feature fails in GJS bindings for Session
add_feature fails in GJS bindings for Session
Status: RESOLVED DUPLICATE of bug 655189
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2014-06-24 00:26 UTC by David Winegar
Modified: 2014-06-24 14:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Winegar 2014-06-24 00:26:47 UTC
Calling soup_session_add_feature in the GJS binding (session.add_feature) results in an error of 'session.add_feature is not a function'. Upon further investigation, even accessing the method signature in GJS results in an error. I have only tested this in the GJS bindings and I am unaware of any problems in other language bindings. It may be that the add_feature function is conflicting with the add_feature property, though I'm not sure.

To reproduce in GJS console:
gjs> var session = new Soup.Session();
gjs> session.add_feature;
(gjs:7138): libsoup-WARNING **: soup-session.c:866: invalid property id 17 for "add-feature" of type 'GParamObject' in 'SoupSession'
gjs> session.add_feature(new Soup.Cache({cache_dir: null, cache_type: 0}));
(gjs:7138): libsoup-WARNING **: soup-session.c:866: invalid property id 17 for "add-feature" of type 'GParamObject' in 'SoupSession'
TypeError: session.add_feature is not a function

A temporary workaround is to pass in the features when constructing the Session object. This is working correctly for me.
Example:
gjs> var cache = new Soup.Cache({cache_dir: null, cache_type: 0});
gjs> var session = new Soup.Session({"add-feature": cache});
gjs> session.has_feature(cache)
true
Comment 1 Dan Winship 2014-06-24 14:10:18 UTC
yeah, known problem, which is considered to be gjs's fault at this point (because the add_feature property is now marked "skip" (bug 655150), so gjs should be ignoring it and seeing only the add_feature method instead).

The other workaround is to do:

  Soup.Session.prototype.add_feature.call(session, feature)

instead of

  session.add_feature(feature)

*** This bug has been marked as a duplicate of bug 655189 ***