Bug 44910

Summary: Pushed statuses are never completely cleared by Gabble plugin
Product: Ytstenut Reporter: Olli Salli <olli.salli>
Component: pluginsAssignee: Robert Staudinger <robert.staudinger>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Olli Salli 2012-01-18 12:09:22 UTC
The Gabble plugin implements one D-Bus method for signaling local service status changes to subscribers:

> AdvertiseStatus(s: Capability, s: Service_Name, s: Status) -> nothing

Ytstenut applications try to use this method, passing an empty status XML, to clear a status e.g. on exit (for example http://cgit.freedesktop.org/ytstenut/telepathy-ytstenut/tree/telepathy-ytstenut-glib/tests/passing-status.c#n72).

However, that only makes the Gabble plugin create a new status node from scratch:

  if (!tp_str_empty (status))
    {
      status_tree = parse_status_body (status, &error);
      if (status_tree == NULL)
        goto out;
    }
  else
    {
      status_tree = wocky_node_tree_new ("status", YTST_STATUS_NS, NULL);
    }

  status_node = wocky_node_tree_get_top_node (status_tree);

  wocky_node_set_attribute (status_node, "from-service",
      service_name);
  wocky_node_set_attribute (status_node, "capability",
      capability);

So a status like any other is pushed, it'll just not have any useful attributes or a description. It will be interpreted as having activity='yts-activity-idle' by spec-compliant receivers.

This makes it a bit hard to distinguish real statuses coming from services from bogus leftover statuses the Gabble plugin generates.

Moreover, XEP-0163 mandates servers to send the last known event on PEP nodes when somebody expresses an interest on them. This means that a spec compliant XMPP server like Prosody will spam everybody with also these Gabble generated empty statuses forever as they sign on or change their capabilities, for all capabilities there has ever been an announced status which has then been "cleared".

To prevent this, the PEP nodes should be deleted when we want to clear the status. This can be done as described at http://xmpp.org/extensions/xep-0060.html#owner-delete. Note that the PEP node has been auto-created while initially pushing the status.
Comment 1 Robert Staudinger 2012-01-24 02:55:35 UTC
Agreed, and as discussed with Olli, statuses should also be cleared from the XMPP server altogether when the service goes away.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.