Bug 40305 - BypassObservers ignored on all handlers except the "best"
Summary: BypassObservers ignored on all handlers except the "best"
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 30043
  Show dependency treegraph
 
Reported: 2011-08-23 05:11 UTC by Simon McVittie
Modified: 2014-01-07 17:49 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2011-08-23 05:11:30 UTC
+++ This bug was initially created as a clone of Bug #40283 +++

> /* this is analogous to *_can_bypass_handlers() method above */

It's _can_bypass_approvers :-)

> static gboolean
> _mcd_dispatch_operation_handlers_can_bypass_observers (
>     McdDispatchOperation *self)
> {
[...]
>     for (iter = self->priv->possible_handlers;
>          iter != NULL && *iter != NULL;
>          iter++)
>     {
[...]
>             gboolean bypass = _mcd_client_proxy_get_bypass_observers (
>                 handler);
> 
>             DEBUG ("%s has BypassObservers=%c", *iter, bypass ? 'T' : 'F');
>             return bypass;

The corresponding code in _can_bypass_approvers explains why we short-circuit in both cases:

>         /* If the best handler that still exists bypasses approval, then
>          * we're going to bypass approval.
>          *
>          * Also, because handlers are sorted with the best ones first, and
>          * handlers with BypassApproval are "better", we can be sure that if
>          * we've found a handler that still exists and does not bypass
>          * approval, no handler bypasses approval. */

However, the second sentence does not apply to BypassObservers - the value of BypassObservers does not affect a Handler's "quality" score (although perhaps it should - see Bug #30043).

So, it should only short-circuit in the TRUE case:

    gboolean bypass = [...];

    DEBUG (...);

    if (bypass)
      return TRUE;
Comment 1 Simon McVittie 2011-09-20 03:37:31 UTC
mcd_dispatcher_client_needs_recovery_cb() is broken in an analogous way, and should be fixed at the same time. Before Xavier fixed Bug #40283, it looked at the Handler that actually took the channel (or crashed if the channel was taken via Claim()), without respecting BypassObservers on any other Handler. After fixing Bug #40283, it respects BypassObservers on one "likely" Handler, but does not respect BypassObservers on any other Handler.
Comment 2 Simon McVittie 2014-01-07 17:49:21 UTC
Fixed in git for 5.17.0 by deleting this feature.


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.