fix(apps): surface relay/control WebSocket construction errors (VAPP-42) #53
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VAPP-42-surface-ws-errors"
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?
What
The browser WebSocket open paths hid construction failures, violating NEVER HIDE ERRORS and masking the real cause of a broken relay:
files.rsmountfell back to a dummyWebSocket::new("ws://localhost:0"), so the only console signal was a misleading "can't establish connection to ws://localhost:0/" - the actual failingrelay_ws_urlwas hidden.terminal.rs/desktop.rsusedWebSocket::new(relay_ws_url).ok()?, silently producing no session and no error.This cost a full debugging round: the true cause (an insecure
ws://relay URL, becauseVERVAIN_SERVER_PUBLIC_URLwashttp://, mixed-content-blocked on the https page) was invisible.Changes
WebSocket::new, all three pages nowconsole::errorthe offending URL with the single-useauthtoken redacted (sharedredact_authhelper inpages/mod.rs, wasm-only) plus the error, and call out the likelyws://-on-https mixed-content cause.files.rs: drop thelocalhost:0dummy;mount/attachreturnOption<FilesHandle>; on failure setConnStatus::Closedandop_errorso the Files page renders its existing error UI instead of mounting a dead socket.Testing
just pre-commitgreen (fmt, clippy-D warnings, server + wasm check, bin tests).Fixes VAPP-42. Relates to VAPP-41.
🤖 Generated with Claude Code