diff --git a/patches/@xhayper+discord-rpc+1.3.0.patch b/patches/@xhayper+discord-rpc+1.3.0.patch index 11615646..3fa55f06 100644 --- a/patches/@xhayper+discord-rpc+1.3.0.patch +++ b/patches/@xhayper+discord-rpc+1.3.0.patch @@ -12,7 +12,7 @@ index 6da3fb1..796344d 100644 platform: NodeJS.Platform[]; format: FormatFunction; diff --git a/node_modules/@xhayper/discord-rpc/dist/transport/IPC.js b/node_modules/@xhayper/discord-rpc/dist/transport/IPC.js -index 2a9a7b3..ee27d82 100644 +index 2a9a7b3..074f5bb 100644 --- a/node_modules/@xhayper/discord-rpc/dist/transport/IPC.js +++ b/node_modules/@xhayper/discord-rpc/dist/transport/IPC.js @@ -59,9 +59,12 @@ const createSocket = async (path) => { @@ -73,3 +73,13 @@ index 2a9a7b3..ee27d82 100644 data = Buffer.concat([data, chunk]); } while (true); if (data.length < 8) { +@@ -187,6 +196,9 @@ class IPCTransport extends Transport_1.Transport { + this.socket = undefined; + this.emit("close", "Closed by Discord"); + }); ++ this.socket.on("error", (e) => { ++ this.emit("error", e); ++ }); + } + send(message, op = IPC_OPCODE.FRAME) { + this.client.emit("debug", `CLIENT => SERVER | OPCODE.${IPC_OPCODE[op]} |`, message); diff --git a/src/backend/common/vendor/discord/DiscordIPCClient.ts b/src/backend/common/vendor/discord/DiscordIPCClient.ts index 5d28d223..05b5f4b5 100644 --- a/src/backend/common/vendor/discord/DiscordIPCClient.ts +++ b/src/backend/common/vendor/discord/DiscordIPCClient.ts @@ -69,6 +69,9 @@ export class DiscordIPCClient extends DiscordAbstractClient { this.client.on('error', (e) => { this.logger.error(e); }); + this.client.transport.on('error', (e) => { + this.logger.error(e); + }); this.client.on('debug', (e) => { this.logger.debug(e); });