diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-11-02 11:00:57 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-11-02 14:51:36 +0100 |
| commit | 4910606da450b6d7d9b42532b3b78b952726ae33 (patch) | |
| tree | 6cab93aec61125fa0e0cea4abf6ea975ed18c5ea | |
| parent | 53408a08fa65cb505a5a4960fea0235143b38672 (diff) | |
| download | mullvadvpn-4910606da450b6d7d9b42532b3b78b952726ae33.tar.xz mullvadvpn-4910606da450b6d7d9b42532b3b78b952726ae33.zip | |
Wrap daemon event stream cancel call in setImmediate
This is a workaround for https://github.com/grpc/grpc-node/issues/1464
which is a bug were canceling the stream just before closeing the gRPC
connection causes a segfault.
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 9df81f119e..4dbae23630 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -569,7 +569,10 @@ export class DaemonRpc { throw error; } }); - subscription.cancel(); + // setImmediate is required due to https://github.com/grpc/grpc-node/issues/1464. Should be + // possible to remove it again after upgrading to Electron 16 which is using a node version + // where this is fixed. + setImmediate(() => subscription.cancel()); } } |
