Skip to content

Subscriptions are not changed until a message from existing subscription is received #293

@at-cf

Description

@at-cf

In init.py of websocket, it would be better like this (commented the original incorrect line):

                    try:
                        # cmsg: Union[
                        #     List[WebSocketMessage], Union[str, bytes]
                        # ] = await s.recv()
                        cmsg: Union[
                            List[WebSocketMessage], Union[str, bytes]
                        ] = await asyncio.wait_for(s.recv(), timeout=1)
                    except asyncio.TimeoutError:
                        continue

Imagine a case where someone is subscribed to trades on an illiquid instrument. So maybe it takes 5-10 minutes before a trade message received. If they try to change the active subscriptions, no error is raised, but silently, no actual change in subscription has ocurred until there's a trade on that illiquid instrument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions