-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
Problem
When running IHP on WSL (Windows Subsystem for Linux), the dev server crashes with a URL parsing error:
redirectToPath: Unable to parse url: "https://downloads.digitallyinduced.com/ihp/1.4.0/linux (WSL)/x86_64/..."
The issue is that the OS name "linux (WSL)" contains spaces and parentheses, which are not URL-safe characters.
Root Cause
In ihp-ide/IHP/Telemetry.hs, the WSL OS name was set to "linux (WSL)":
let opsys
| System.os == "linux" && iswin = "linux (WSL)" -- contains spaces!
| otherwise = System.osWhen this is sent to the telemetry server and used in a URL path, it causes a parsing error.
Proposed Fix
Change the OS name to a URL-safe format: "linux-wsl"
normalizeOsName :: String -> Bool -> String
normalizeOsName "linux" True = "linux-wsl"
normalizeOsName osName _ = osNameQuestions for Maintainers
- Will the telemetry server correctly handle the new OS identifier
"linux-wsl"? - Does the server need to be updated to recognize this new identifier?
- Should the server-side code also be fixed to properly URL-encode OS names when building URLs?
Changes Included in PR
- Refactored OS name normalization into a pure function
normalizeOsName - Added comprehensive tests for the telemetry module
- Added
devenv testconfiguration
Environment
- OS: Linux (WSL2)
- IHP Version: 1.4.0
Metadata
Metadata
Assignees
Labels
No labels