From 6b0da6b879ded311a2ed57a7b77de8cccb5c89ca Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Mon, 12 Dec 2022 04:00:49 -0500 Subject: [PATCH] Fix condition to warn about IPC handle (#1143) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have an extension that always shows the following warning (actual path differs each time): > WARNING: IPC handle "/var/folders/w_/zfvfxj_x3nbd8wlj9p4ck3xc0000gn/T/vscode-d7124c14bae4868834641c7c08175ab90b7b0993a8.sock" is longer than 103 characters. This path's length is 103 characters, which is the safe limit for macOS [1]. However the warning is still displayed because of the condition `>=` was used [2]. [1] https://nodejs.org/api/net.html#identifying-paths-for-ipc-connections [2] https://github.com/microsoft/vscode-languageserver-node/commit/bbd65f68bb882d24ba612a84481577403f926e3d Co-authored-by: Dirk Bäumer --- jsonrpc/src/node/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonrpc/src/node/main.ts b/jsonrpc/src/node/main.ts index 3b7125ffa..492af7b85 100644 --- a/jsonrpc/src/node/main.ts +++ b/jsonrpc/src/node/main.ts @@ -186,7 +186,7 @@ export function generateRandomPipeName(): string { } const limit = safeIpcPathLengths.get(process.platform); - if (limit !== undefined && result.length >= limit) { + if (limit !== undefined && result.length > limit) { RIL().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`); } return result;