Launcher robustness: settings.json reset on parse error, UI editor overwrites API edits, generated screen = host, hardwareConcurrency vs real threads, cdp missing from start response
Five smaller launcher issues found while auditing 2.0.1 on Windows 11 x64, grouped because each is a few lines. Happy to split if preferred.
1. settings.json is silently reset to zero-values on any parse error.
settings::load() does serde_json::from_str(&body).unwrap_or_default(); ensure_secret() then persists the default struct with a fresh api_secret. A UTF-8 BOM (PowerShell 5 Set-Content -Encoding UTF8) is enough: API disabled, api_port=0, theme empty, tray off, and every issued JWT invalidated, with no message. Suggest: fail loudly (keep the file, log, show a banner) and never regenerate api_secret implicitly.
2. UI editor overwrites API changes with stale state (follow-up to #7).
profile_save persists the editor's in-memory payload verbatim. Sequence: open editor → PATCH /profiles/{id} from a script (new noise seeds, geolocation=manual) → save in editor → the API changes are reverted while fields the editor happened to reload survive. Suggest: reload the editor on the profiles store-changed event, or reject a save whose base revision is stale.
3. Generated fingerprints inherit the host screen.
GET /fingerprint/new/Windows and POST /profiles/temporary return screen = 5120×1440 / avail 1392 (the host's ultrawide) for every GPU preset. That resolution is rare, identical across all generated profiles on the machine, and equals the real monitor. Suggest: pick the screen from the preset's real-device sample (1920×1080 etc.) and only clamp to the host when the claimed size exceeds it.
4. hardware_concurrency below the real thread count is measurable.
Presets declare e.g. 6 cores on an 8-thread host; a Web-Worker throughput probe (k identical workers, wall time flat until k = real threads) recovers 8. Suggest: randomize_hardware should never pick fewer threads than the host exposes (SDK/launcher know available_parallelism()).
5. POST /profiles/{id}/start?cdp=true intermittently returns no cdp object.
Sometimes the response has only pid; the log prints CDP ready for <id>: ws://... a few seconds later. Clients fall back to reading DevToolsActivePort. Suggest: await the CDP-ready event before responding (bounded), or document the polling contract.
in v2.0.3