fix(desktop): say tunnels are unavailable instead of faking a session #95
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VAPP-86-desktop-tunnel-unsupported"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stops the desktop app pretending to open remote sessions. It does not make the panes work; native drivers stay open as follow-up. This is the AC floor from VAPP-86: "must not silently pretend to connect".
The bug
The terminal/files/desktop session drivers are built directly on browser APIs (xterm.js and the DOM, canvas +
RTCPeerConnection, the File System Access API) and are compiled only forwasm32. Every other target gets no-op stubs. That is correct for the SSR pass, where the pane renders to HTML and is never interactive.The desktop build inherits it too.
dioxus-desktopruns the app natively, so it is notwasm32and silently selects the same stubs: pane chrome renders, no socket opens, every button is a no-op.files.rswas worst because its stub returnsSome(FilesHandle)(files.rs:452), so the pane looked attached and sat on "Connecting to device…" with an empty listing forever.Telling detail:
terminal.rs:113already resolves the vendored xterm asset URLs undercfg(feature = "desktop")(from VAPP-53). The asset plumbing was made desktop-aware; the driver that would use it never was. This reads as an oversight, not deliberate scoping.The change
Each pane checks
cfg!(feature = "desktop")before any hook and renders aTunnelUnsupportedcard naming the tunnel and pointing at the web console. Checking before the hooks also means the desktop build stops minting relay cookies and asking an agent to dial a relay for a session it cannot drive.The subtle part, and why there is a guard
The gate keys on the feature, never on
target_arch.target_archis the more natural-looking cfg (it is what the stubs themselves use) and it is a trap: the SSR pass is also notwasm32, so gating on it would stamp "not available in the desktop app" into every web page load and hydrate it away. That is the VAPP-85 flash class again, on the tunnel panes.tunnel_gate_guard.rspins both halves, because both regressions compile cleanly and only surface in front of a user:target_arch-> the web console starts flashing a desktop-only message.I verified the guard fails on each regression rather than only passing as written:
Verification
The whole fix hangs on
dxactually enabling the feature the gate reads, so I checked instead of assuming:Corroborated by the
cfg(feature = "desktop")code already load-bearing on the shipped app: the embedded-asset handler (VAPP-53) and the server-URL editor (VAPP-54/58) both work there, which they could not if the feature were off.fmt, 102 tests, and the server, wasm and desktop-feature checks all pass (all three matter here, since each selects a different path through the gate). The six
clippy::unnecessary_sort_byerrors inserver_fns/mod.rsare pre-existing and reproduce on a cleanmain.Not covered
Not run in a desktop window (no webview in the sandbox), so the rendered card is unconfirmed. The cfg selection is not in doubt; the wording and layout deserve one look on a real build.