Repository navigation
fix(client-runtime): Local folder finds an existing UNC project typed with forward slashes - #34760
juliusmarminge wants to merge 2 commits into
Conversation
…ws project Fails on main: reproduces #34755. AI-assisted; verified with the tests and tools listed above.
… with forward slashes findProjectByPath compared //server/share/repo literally, so it missed a Windows project at \\server\share\repo. A leading \\ on either side shows the environment is Windows, so both are then compared as UNC paths; POSIX // paths keep their literal comparison. Fixes #34755 AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Existing UNC projects can now be found when their paths are entered with forward slashes. The adjustment is limited to path comparison, preserves environment-scoped lookup, and introduces no network access or product-default changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The automated pipeline stopped on this pull request and will not merge it: the proof has no capture anyone can open:
It stays open for a person to finish or close. |
findProjectByPath (packages/client-runtime/src/state/projects.ts), the lookup used by findExistingAddProject and the web lookups, compared
//server/share/repoto a stored\\server\share\repoas plain text, because normalizeProjectPathForComparison only treats a leading\\as UNC. Now, when both paths start with two separators and at least one starts with\\(which only a Windows environment can hold), both have/turned into\and go through the existing comparison normaliser, so they match ignoring case. POSIX//paths are never compared that way and still match exactly, literal backslashes included (#29245), with no need to pass the platform in. I left normalizeProjectPathForComparison itself alone because server and file-metadata cache keys share it. No new regex: the change uses the existing isNetworkPath check (/^[\\/]{2}/), which only looks at the first two characters and runs in constant time on any input. I did not test against a real Windows server.Fixes #34755
Reproduction on main
On origin/main a41b882, after
vp i, I added a project with workspaceRoot\\server\share\repoto the existing 'finds existing projects by normalized path in the target environment' test in packages/client-runtime/src/operations/projects.test.ts and asserted that findExistingAddProject({ path: '//server/share/repo' }) returns it.vp test run packages/client-runtime/src/operations/projects.test.tsgives 1 failed, 9 passed: 'expected undefined to be unc-project'. This calls the same production resolver and lookup that mobile's Local folder submit uses. I did not run a native mobile client against a Windows server because no worker has a Windows environment, so the result rests on the shared lookup the UI calls.Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run packages/client-runtime/src/operations/projects.test.ts: failed 1/10 before the fix (the repro), passed 10/10 after. vp test run packages/client-runtime/src/operations/projects.test.ts packages/client-runtime/src/state: 69 files, 903 tests passed. vp run check:changed: format, lint, knip, typecheck (7 packages) and tests all passed.
Not in this change
AI-assisted; verified with the tests and tools listed above.