grpc-web-devtools
grpc-web-devtools copied to clipboard
Calls to stream methods removeListener and cancel being ignored
The current DevToolsStreamInterceptor
implementation doesn't support calls to the stream's methods removeListener
and cancel
as calling these methods on the interceptor just does nothing. This leads to streams not being cancelled while the devtools are open.
It looks like I stubbed these out deliberately, but can't recall why. -1 to myself for not leaving a comment.
I do recall at the time the implementation for streaming wasn't fully baked. It's possible those calls caused problems back then that have since been resolved. I'd like to have a peek at the grpc library to see what's changed and if there are any obvious gotchas. Have you tested it out? Thanks!
Thanks for your reply! Yes, we have a version of the devtools with this fix running in our team and it has fixed our imminent issue of cancel
calls not going through. I'm not sure about removeListener
though. If I should have a look at that or test anything else, let me know!
Was the issue that if the cancel call does not propagate the stream won't cancel properly? Mainly I just want to look through the implementation of grpc to see if there's an obvious reason I omitted those calls. It's possible I just missed it.
Yes exactly, we register a callback using stream.on('data', response => {...})
and after eventually calling stream.cancel()
are continuing to receive calls to that callback as the stream isn't cancelled.