Giter Site home page Giter Site logo

Comments (3)

engn33r avatar engn33r commented on August 14, 2024

Hi, websocket-client maintainer here 👋 Thanks for bringing this to my attention. Do you have a more detailed error message indicating the line numbers where these errors were triggered on? Based on what I can see, the _on_message and _on_open functions are defined only in Pysher (a search for those functions in websocket-client gives no results), but the error from callback <exception> message looks like it is from this line of websocket/_app.py in websocket-client. I will look at this in more detail later to try and recreate it, but one starting point would be to check whether using "self" in the Pysher _on_message and _on_open functions is done properly based on the current websocket-client _app.py code. I think the current Pysher usage may be based on the inheritance the websocket-client PR 442 introduced (in release 0.49.0), and which has since been fully reverted because this PR caused many issues. Some examples of websocket-client that may be useful to reference are here, here, and here.

I see the requirements.txt for this project is using websocket-client v0.51.0 - have you checked if any more recent version of websocket-client works? Errors related to this callback code have created many of the websocket-client issues, so it's been a problem point for a while, and any information to pinpoint this better would be great. At the same time, if Pysher is relying on features introduced by PR 442 of websocket-client, then some Pysher code may need modification (or the websocket-client project would need a version of PR 442 that doesn't cause errors).

from pysher.

Jnesselr avatar Jnesselr commented on August 14, 2024

@engn33r So I'm running into this same issue. It looks like Pysher doesn't do websocket inheritance: https://github.com/deepbrook/Pysher/blob/master/pysher/connection.py#L107

I'm actually seeing this commit which added the ws in there and another that reverted:
original: c7f95c6
revert: 285f063

Looking through everything, I'd say this commit is the culprit: websocket-client/websocket-client@40e3a93

That being said, the documentation in _app.py for websocket-client does look like it specifies that the first argument should be the websocket client itself.

Version 0.58.0 has this issue, version 0.57.0 doesn't if anyone is just looking for a temporary workaround. Testing commit 2bdda8a76993d1aefa9926579f2b83e8f34c22c7 of websocket-client does still have the issue.

I don't know what the correct solution is here, but it does appear that the websocket-client changed behavior. I think there was some confusion about how self gets used for bound methods and what the "self" would be if you used inheritance on the websocket app vs had it as a member variable.

Let me know if you need any more debugging!

from pysher.

engn33r avatar engn33r commented on August 14, 2024

Thanks @massiou @Jnesselr. When this issue was first posted, it was the first one to point out that the change in inheritance handling broke some uses of websocket-client. However, it was only the first to report this behavior out of many, as websocket-client issues #669, #668, and #667 show, so I am now aware with what exactly the issue is. What I should have done with websocket-client is followed semantic versioning and released version 1.0.0 (which I will do with the next websocket-client release) to indicate a breaking change that may not be compatible with older releases. However, because commit 3112b7d was fixing an improper revert of an old PR (see the detailed explanation below that commit), I did not do this. So the options for any project impacted by this change, including Pysher, is to modify how you use websocket-client to work with the 0.58.0 removal of inheritance or specify websocket-client==0.57.0 in your requirements.txt.

from pysher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.