Repository navigation
fix(server): resolve the VS Code IPC registry path per call - #1621
Merged
backnotprop merged 2 commits intoSep 27, 2026
Merged
backnotprop merged 2 commits into
backnotprop merged 2 commits into
Conversation
browser.ts froze vscode-ipc.json at import time, so a PLANNOTATOR_DATA_DIR set or changed after import left tryVscodeIpc reading the old data directory. Resolve the path on every call, the same pattern backnotprop#1490 applied to the other server modules. Closes backnotprop#1502
Contributor
Author
|
CI failed... 🇨🇿 ing... |
Owner
|
Thanks @gwynnnplaine! Reviewed, tested, and merged. The earlier CI failure was a network timeout in the Windows smoke job, unrelated to your change. This will go out in the next release. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #1502
Root cause
packages/server/browser.tscomputed the VS Code IPC registry path once, at module load:A
PLANNOTATOR_DATA_DIRset or changed afterbrowser.tswas imported lefttryVscodeIpcreadingvscode-ipc.jsonfrom the old data directory, so opening the review in VS Code silently fell through to the next strategy. #1490 fixed the same import-time freeze in the other server modules; this module was left over.Fix
Resolve the path on every call (
ipcRegistryPath()), the same shape #1490 used. No caching is needed: the registry is read once per browser-open attempt.tryVscodeIpcis now exported so the fallback can be tested directly, without drivingopenBrowserthroughPLANNOTATOR_BROWSER/BROWSERand without any risk of launching a real browser from the test.Tests
Two tests in
packages/server/browser.test.ts. The module is imported statically, before anyPLANNOTATOR_DATA_DIRis set, which is the shape of the bug:PLANNOTATOR_DATA_DIRset after import: a registry in a temp data dir routes the current workspace to a local stand-in IPC server, which must receive/open?url=….PLANNOTATOR_DATA_DIR: switching data dirs between two calls routes the second call to the second server.PLANNOTATOR_DATA_DIRis set inside each test and restored throughcreateTestEnvironment. Each stand-in server is scoped to its test and stopped with an awaitedstop(true).Verified:
bun test packages/server/browser.test.ts: 16/16 pass on 20 consecutive runs.bun test(full suite): 5364 pass, 0 fail.bun run typecheck: passes.Out of scope
apps/vscode-extension/src/extension.ts:12has the same import-time pattern for the writer side. It runs in the VS Code extension host, a separate process that is not covered by #1502, so I left it unchanged.This PR was written with the help of an AI agent (Pi).