[Bug 26059] New: Requests Mixin doesn't create Handles on demand

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jan 15 13:06:37 CET 2010


http://bugs.freedesktop.org/show_bug.cgi?id=26059

           Summary: Requests Mixin doesn't create Handles on demand
           Product: Telepathy
           Version: git master
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: tp-python
        AssignedTo: telepathy-bugs at lists.freedesktop.org
        ReportedBy: eopage at byu.net


Version: 0.15.13-1

Reproduction Steps:

1. In a telepathy client (tested in RTComm) the user selects "Send IM To"
2. The user enters the contact identifier for someone not on the
contact list (so no previous handles created)

Expected Outcome:

1. Clients will call ConnectionInterfaceRequests.CreateChannels with
TargetHandleId set as the contact name.
2. CreateChannels (through _alter_properties) calls an internal
equivalent of RequestHandles to get a TargetHandle for the
TargetHandleId, creating a new handle if needed.

Actual Outcome:

1. Clients will call ConnectionInterfaceRequests.CreateChannels with
TargetHandleId set as the contact name.
2. CreateChannels (through _alter_properties) searches among existing
handles, checking if the "get_name() == TargetHandleId"
3. The handle has not previously been created and an exception is raised

Notes:

This puts on the requirement that the handle had to already exist
which makes calling without a TargetHandle pointless.
Handle.get_name() is checked directly against user input, not allowing
CM implementers to normalize the names that come in
When constructing the exception that gets thrown for an invalid
contact, the string formatting is setup incorrectly and a different
exception will be thrown instead.

Fix:

I've branched the latest Master of telepathy-python.  I extracted code
from the default implementation of RequestHandles and made it a
function called "get_handle_by_name".  I then made the requests
interface call that.   As a parallel function, I also implemented
"get_handle_by_id" which is a simplistic function that clients are
expected to implement for the Channel mixins (previously the channel
mixins called it "handle" which I found quite an ambiguous name).
git://github.com/epage/telepathy-python.git


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the telepathy-bugs mailing list