From 540f694f01436de2e29a68536c164bafd1bb305c Mon Sep 17 00:00:00 2001 From: Kelorastus <108483685+Kelorastus@users.noreply.github.com> Date: Fri, 2 Oct 2026 16:19:24 +0200 Subject: [PATCH] Revert "dev mode: prefer the DHP's data, fall back to the local install" This reverts commit 53bba10b3ef5177e356e73835473b1ca5803fc5f. --- src-tauri/src/launcher.rs | 36 +++++-------------------------- src/components/ActionPanel.svelte | 9 +++----- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/src-tauri/src/launcher.rs b/src-tauri/src/launcher.rs index 62300a5..1c869ac 100644 --- a/src-tauri/src/launcher.rs +++ b/src-tauri/src/launcher.rs @@ -696,27 +696,22 @@ impl Launcher { repo.join("tools").join("build").join("build.bat").is_file().then_some(repo) } - /// The DHP-backed dev run: the client comes from the checkout and its data comes from the - /// DHP - live tracks, live tiles, nothing installed needed. + /// Can this PC run a dev client with no install at all, straight against its DHP? /// - /// PREFERRED whenever dev mode is on and the DHP answers, installed or not. A dev run is - /// for working on the client, and the DHP holds the data worth working against; the local - /// stack is the fallback for when the DHP cannot be reached. Deciding it by "is anything - /// installed" guessed wrong in both directions: a PC with an old install silently ran on - /// stale local data, and nothing on screen said so. + /// Only with nothing installed: where there IS an install the local stack is the better + /// run - it holds this PC's own data and it is what an operator actually uses. This is + /// purely the case that used to be refused outright. /// /// Every reason it might not work is checked here rather than at launch, because the hub /// needs to know whether to offer Launch at all. fn dhp_direct(inner: &Inner) -> Option { - if Self::dev_engine(inner).is_none() || !inner.online { + if Self::dev_engine(inner).is_none() || !inner.online || inner.state.installed_version.is_some() { return None; } let mcp = inner.settings.mcp_url.trim(); if mcp.is_empty() { return None; } - // The DHP's own Engine API, as its health answer named it. None means the DHP did not - // say where it is, so there is nothing to point a client at and the run falls back. Some(DhpDirect { engine_url: inner.engine_url.clone()?, mcp_url: mcp.to_string(), @@ -2980,27 +2975,6 @@ fn swapped_user<'a>(asked: &'a str, operator: Option<&str>) -> Option<&'a str> { mod tests { use super::*; - /// The rule the hub now follows: the DHP is PREFERRED, the install is the fallback. - /// Written as a table because the old version decided this by "is anything installed", - /// which was wrong in both directions. - #[test] - fn the_dhp_is_preferred_and_the_install_is_the_fallback() { - // (dev mode, online, installed) -> what a dev run should use - let cases = [ - (true, true, true, "dhp"), // installed, but online: the live data wins - (true, true, false, "dhp"), // nothing installed: the case that was refused outright - (true, false, true, "local"), // no DHP: fall back to what is on this PC - (true, false, false, "none"), // no DHP and nothing installed: nothing to run - (false, true, true, "local"), // dev mode off: an ordinary operator launch - ]; - for (dev, online, installed, want) in cases { - // dhp_direct() needs an Inner, so this asserts the DECISION the gate encodes rather - // than calling it: dev && online picks the DHP, and only then does install matter. - let got = if dev && online { "dhp" } else if installed { "local" } else { "none" }; - assert_eq!(got, want, "dev={dev} online={online} installed={installed}"); - } - } - #[test] fn nothing_installed_still_launches_when_the_dhp_can_stand_in() { // The whole point of the DHP-direct run: a checkout and a reachable DHP are enough. diff --git a/src/components/ActionPanel.svelte b/src/components/ActionPanel.svelte index 7a75d9e..063edc1 100644 --- a/src/components/ActionPanel.svelte +++ b/src/components/ActionPanel.svelte @@ -243,12 +243,9 @@

{#if checking} Checking {site}… - {:else if s?.dhp_direct} - - Live from {site}: the client comes from your checkout and its data, - tracks and map come from the DHP. You sign in inside ODIAN, not here. - {#if s?.installed}Nothing local starts; {s.installed} is used only when the DHP is unreachable.{/if} + {:else if !s?.installed} + Nothing is installed here: the client comes from your checkout and runs on + {site}'s data. You sign in inside ODIAN, not here. {:else if s?.update_required} ODIAN {s.installed} is installed, {s.available} is on {site}. A dev run starts