Open stevenaldinger opened 3 years ago
this fixes the panic: https://github.com/sacOO7/socketcluster-client-go/pull/15
@stevenaldinger: how do you fix this?
@gobliggg in scclient/parser/parser.go
line 28: https://github.com/sacOO7/socketcluster-client-go/blob/master/scclient/parser/parser.go#L28
replace:
itemsMap := message.(map[string]interface{})
with a check that the conversion is successful. keep in mind there's likely some deeper rooted issue that the conversion failed to begin with, but its still important to be catching errors like this. I'm not sure what appropriate error handling should be happening here, this just completely ignores the error instead of letting it panic:
itemsMap, ok := message.(map[string]interface{})
if !ok {
return
}
Appears to be fixed in github.com/sacOO7/socketcluster-client-go v1.0.1-0.20230922063628-e06423a4ac46
This happens a few seconds after successfully connecting to the server when I run the code in the README. No message is being published and there's nothing but a fmt.Println in my
startCode
function.Is this client maintained/expected to work with the latest socketcluster server release?