crossbario / crossbario/autobahn-python

ISession interface not respected for wamp.protocol.ApplicationSession.join

Open
#605 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

It seems there is a slight difference between in the interface ISession.leave and it implementation in the protocol.ApplicationSession.leave:

https://github.com/crossbario/autobahn-python/blob/master/autobahn/wamp/interfaces.py#L298

class ApplicationSession(BaseSession):
    ...
    @abc.abstractmethod
    def leave(self, reason=None, message=None):
        ...

https://github.com/crossbario/autobahn-python/blob/master/autobahn/wamp/protocol.py#L1040

class ISession(object):
    ...
    def leave(self, reason=None, log_message=None):
        """
        Implements :func:`autobahn.wamp.interfaces.ISession.leave`
        """
       ...

This should cause a crash if ApplicationSession.leave is called with it params as kwargs (log_message vs message)

And just for curiosity: why ApplicationSession doesn't inherit from ISession given it should implement it ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the ISession.leave declaration in autobahn/wamp/interfaces.py with ApplicationSession.leave in autobahn/wamp/protocol.py, focusing on the differing keyword parameter names. Confirm the intended inheritance relationship mentioned in the issue. Done means the implementation respects the interface for keyword calls and the inheritance question is resolved in the relevant API design.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.