gRPC response not getting sent to client inside setTimeout when running in renderer process in electron

893 views Asked by At

I am using the @grpc/grpc-js module and I have setup a sample gRPC server:

When I run a gRPC server in electron, if I send a response after a "timeout", then the response is not going to the client at all. It's not closing the http2 stream properly. The same server works fine when run in node directly but giving this issue when run through electron.

The issue doesn't happen if I send the response directly outside the timeout function.

Sample Minimal Project which demonstrates the issue: https://github.com/nateshmbhat/grpc-with-electron-sample-project

Expected Behavior

When the gRPC server sends the response with or without the timeout, the response should reach the client and the associated streams should close properly.

Actual Behavior

Though the server sends the response, the response is not reaching the client. So, the connection and stream don't close.

I have also filed issues for this here:

https://github.com/electron/electron/issues/26838

https://github.com/grpc/grpc-node/issues/1645

0

There are 0 answers