mandrewcito / signalrcore

SignalR Core python client
https://mandrewcito.github.io/signalrcore/
MIT License
115 stars 53 forks source link

send method use same uuid str eveytime. cause incorrect CompletionMessage. #90

Closed hs-CN closed 1 year ago

hs-CN commented 2 years ago

Describe the bug

def send(self, method, arguments, on_invocation=None, invocation_id=str(uuid.uuid4())) -> InvocationResult:

invocation_id=str(uuid.uuid4()) this code will generate a uuid str just only once.

To Reproduce print( invocation_id), and call send method without specify ‘invocation_id’.

def on_open():
    print("signalr open")
    client.send("ClearWatch", [])

    def call_back(result: CompletionMessage):
        # print("callback")
        # print(result.type)
        # print(result.invocation_id)
        # print(result.error)
        # print(result.result)
        pass

    client.send("WatchOnPLC", [[]], call_back)
PS D:\Github\signalrcore> python .\test.py
signalr open
7ebd47dd-1401-4e55-beb0-9de07fbfd539
7ebd47dd-1401-4e55-beb0-9de07fbfd539

Desktop (please complete the following information):

mandrewcito commented 1 year ago

Fix in PR #95

jurrian commented 7 months ago

@mandrewcito can this be released pls? The problem is fixed in main branch but still persists in the current latest version.