Repository navigation
fix(ssh): read the Windows bridge registry as UTF-8 - #3853
tunatuna1002-lab wants to merge 1 commit into
Conversation
The bridge writes its registry files as UTF-8 without a BOM, and Windows PowerShell 5.1 reads such a file in the ANSI code page. On a PC whose profile path has non-ASCII characters the descriptor's socket_path no longer matched (or the line no longer parsed), so a started bridge was never found and Connect ended in "Bridge did not start". Read both registry listings with -Encoding UTF8. Fixes devswha#3852 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA. Thank you! |
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
I have read the CLA Document and I hereby sign the CLA |
|
Thank you, @tunatuna1002-lab. The merge pass reviewed this at 54c02ab with two reviewers under the stricter bar for outside PRs; both are clear, and nothing in the supply chain changes (the existing remote PowerShell scripts gain One LOW, for you to take or leave: the |
Fixes #3852
Change
On a native Windows PC whose user profile has non-ASCII characters (for example
C:\Users\홍길동), the bridge started but the server never found it, so Connect and every bridge update ended in "Bridge did not start" with nothing inbridge.log.The bridge writes its registry files as UTF-8 without a BOM. Windows PowerShell 5.1 reads such a file in the ANSI code page, so
socket_pathcame back changed (on a Korean PC, code page 949, the line no longer parsed at all) anddescriptors()dropped the new bridge.server/remote-host.ts: both registry reads (WINDOWS_DESCRIPTORSand the clean-up inwindowsHost.stop) now useGet-Content -Raw -Encoding UTF8.-Encoding UTF8is accepted by Windows PowerShell 5.1 and PowerShell 7. The otherGet-Content -Rawin this file reads the install lock owner, a sha256 hex string, so it is left as is.server/windows-native.test.ts: the registry fixture'ssocket_pathis nowC:\Users\홍길동\herdr.sock, so the existing launcher/registry test covers a non-ASCII profile fordescriptors(),inspect()andstop().changelog.d/windows-registry-non-ascii-profile.md: a Fixed entry.Validation
bun run check faston macOS (Apple silicon, Bun 1.4.4): types, themes, typecheck and build are ok.test:unitfailed in 27 files (CI build cache, browser/iOS workflow scripts, relay timing and similar). They look tied to my machine, not this change: the same 27 files on unmodifiedmain(70e9ed7) gave the same result, 1069 pass and 97 fail, and the same failing tests apart from one timing test in the loopback relay, which failed on each side with a different case.bun test scripts/changelog-fold.test.ts server/windows-native.test.ts server/machines.test.tson macOS: 104 pass, 16 skip (the Windows-only cases), 0 fail.%USERPROFILE%\.config\herdr-web-ui\bridgesand ran the two registry scripts throughpowershell -EncodedCommandwith UTF-8 output, asrunPowerShelldoes:descriptors()read did not return the fixture, and thestop()clean-up left the file;stop()removed the file.bun run check fullandbun run test:ssh. I expect the Windows CI runners (code page 1252) to fail the updated test without the fix, because the UTF-8 bytes of the fixture decode to other characters there; I could not check this myself.🤖 Generated with Claude Code