Skip to content

[json_rpc_2] Client.sendRequest() never completes #2202

@d-markey

Description

@d-markey

Hello,

I've run into a situation where a request never completes. The context is with requests sent from within a browser: CORS comes into play, so a response never comes through when the target server does not support CORS (I guess the fetch operation fails too early in the pipeline).

I've managed to trace it down to the Peer class which has forwarders for the server and the client. As it happens, the error does come through in the onError callback installed in _channel.stream.listen(). However, that callback only forwards errors to the _serverIncomingForwarder. In fact, _clientIncomingForwarder.addError is never called so no error can ever be notified via that channel.

}, onError: (Object error, StackTrace stackTrace) {
_serverIncomingForwarder.addError(error, stackTrace);
}, onDone: close);

FYI I modified my local copy so that the error gets forwarded to both the server and the client, and it fixed the issue.

I don't know if it's the right way to go as I'm not sure whether errors should be dispatched to the client or the server only and on what condition, so I'll let you look at it!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions