Skip to content

Commit

Permalink
Fix condition to warn about IPC handle (#1143)
Browse files Browse the repository at this point in the history
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] bbd65f6

Co-authored-by: Dirk Bäumer <[email protected]>
  • Loading branch information
spouliot and dbaeumer authored Dec 12, 2022
1 parent 23b04fd commit 6b0da6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonrpc/src/node/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6b0da6b

Please sign in to comment.