Closed Mol0ko closed 4 years ago
Useful line of error log:
E/flutter (12538): #0 WebSocketTransport.connect.<anonymous closure>
package:signalr_core/…/transports/web_socket_transport.dart:79
After debugging this I found the cause of an error. It throws from this line: https://github.com/jamiewest/signalr_core/blob/b4e1bed19e7892dec598895052c60205722055b7/lib/src/json_hub_protocol.dart#L164
I think the first if operator of method _isCompletionMessage
is useless as the second (with _assertNotEmptyString
) do the same. _isCompletionMessage
could be like that:
void _isCompletionMessage(CompletionMessage message) {
if ((message.result == null) && (message.error != null)) {
_assertNotEmptyString(
message.error, 'Invalid payload for Completion message.');
}
_assertNotEmptyString(
message.invocationId, 'Invalid payload for Completion message.');
}
In this case the error is gone.
I can successfully connect to server and get success message from logger like this:
But after further call
invoke
method ofHubConnection
and get a valid json response with type 3 (completion) I am getting an error. Here is long debug log of an error:Here is my code: