Repository navigation
Conversation
The Mac app treated any leftover wt_info.json as the daemon listener and cached that port for signaling. Browsers dial wtUrl from connection_request and connection_accepted, so a previous launch's port hangs Mac-to-browser transfers. Ignore endpoint files this daemon did not rewrite, and re-read them before each advertisement. If no live listener exists, cancel the browser connect instead of waiting. Host.localizedName can be the bind address 0.0.0.0. Advertise the System Settings computer name, and never show a bind address as a peer name when a real device name is available. Co-authored-by: Evan Oberfelder <evanoberfelder@gmail.com>
The daemon ask sheet was rendering peer_addr as the device name and Accept copied that socket string over the signaling name, so the connected header showed a LAN IP and ephemeral port. Prefer the advertised name and type, and treat socket labels as unusable display names without changing which hosts are advertised for WebTransport. Co-authored-by: Evan Oberfelder <evanoberfelder@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Mac app ↔ browser transfers hang after Accept because the Mac advertises a WebTransport endpoint that is no longer listening. Mac↔Mac still works: that path sends
wsUrland falls back to WebSocket when QUIC metadata is stale. Browsers on https://localbolt.app cannot usews://, so they dialwtUrl+certHashfromconnection_request/connection_acceptedand wait.wt_info.jsonlives in the persistent daemon data dir (~/Library/Application Support/LocalBolt/daemon). The app polled until that file existed, then cachedwt_port/wt_cert_hashonce. A previous launch's file is almost always already there, and the WS port is9100 + (app pid % 900)with WebTransport on WS+1, so the cached port does not match the daemon that just started. The daemon does rewrite the file (wt_port = ws_port + 1in bolt-daemon); the shell never read it again.Separately, the device list showed
0.0.0.0for a Mac Studio. The UI prints signalingdevice_name, and registration usedHost.localizedName. That is NSHost, which returns the wildcard bind address on some Macs.?? "Mac"does not run, because the string is non-nil. The browser (localbolt-v3) also displaysdevice_nameand does not invent it fromwtUrl, so no companion change is required there for the device list.LAN verify of the device list succeeded: the MacBook now shows the Studio computer name. Two labels on the Studio were still wrong when the MacBook connected:
PairingRequestView: "Connection Request", Remember this device, Block) showed0.0.0.0:0andunknown.192.168.4.25:55170(MacBook LAN IP + ephemeral port) with Approved, not the advertised name (Evan's MacBook Pro).bolt-daemon
ipc/trust.rssetsremote_device_nametofrom_peer.to_string()andremote_device_typeto"unknown". The session loop passespeer_addr(the realip:port). WS outbound uses a synthetic0.0.0.0:0. The Mac app copied that string into the ask sheet and, on Accept, overwrotependingAcceptPeer, so the connected header lost the name signaling already had onconnection_request, the peer list, andpendingAcceptPeer.Fix
wt_info.jsonandquic_info.jsonbefore spawning the daemon. Advertise a record only when its bytes changed (or the file was created this launch) and the port is this process's WS+1 (WT) or WS+2 (QUIC).connection_requestandconnection_accepted. QUIC is omitted when the file is stale, so native peers stay on the existing WebSocket fallback..connecting.SCDynamicStoreCopyComputerName), then a usablelocalizedNameor hostname. Never register or display0.0.0.0/::. A later realdevice_namereplaces a bind-address entry already in the peer list.IP:port(including a real LAN address such as192.168.4.25:55170and0.0.0.0:0), bare IPs, and::. The ask sheet and session header use the same helper as the device list, so a leftover socket cannot render. A LAN address is still a valid WebTransport host — that check is separate, and wtUrl refresh is unchanged.connectedPeer(IPCsession-connectedand the WebTransport stderr path), preferpendingAcceptPeer,pendingInitiatorPeer, the in-flightconnection_request, or the single discovered peer over a socket name."unknown"yields to the advertised device type and is omitted when nothing better is known.Discovery
wt_urlis still whatever was known when signaling registered (the server rejects a secondregister). localbolt-v3 dials the connection payload, which is refreshed.Companion change still required in bolt-daemon
This PR does not modify bolt-daemon. A separate agent should change
bolt-ecosystem/bolt-daemonsoipc/trust.rsstops writingpeer_addr(and the synthetic0.0.0.0:0) intoremote_device_name, and stops sendingremote_device_type: "unknown"when the peer advertised a name and type. Until that lands, the Mac app substitutes the signaling identity. The sheet and the connected header show the advertised name (for example Evan's MacBook Pro) instead of the socket.No localbolt-v3 change is required for either bug.
Verify on a Mac (same LAN, localbolt.app open)
~/Library/Application Support/LocalBolt/daemon/wt_info.jsonexists and notewt_port.[WT] advertising https://<lan-ip>:<port>with a port that matches the new file (wt_port= daemon WS port + 1), not the leftover.0.0.0.0.quic_info.jsonwas rewritten this launch, otherwise WebSocket).0.0.0.0:0/unknown.192.168.4.25:<ephemeral port>.