You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
apps/box: Diagnostics — real TCP probe to relay :4001 (kubo libp2p)
The previous HTTPS-HEAD-on-:443 probe was a false-negative machine
for Fula relays. They're kubo-based and only expose libp2p
multistream on TCP :4001 — no HTTPS termination on :443, no admin
ports. Every working relay was showing red.
Replace the probe with a real TCP socket connect to :4001:
- Add react-native-tcp-socket@6.4.1 as a native dep. RN's built-in
fetch + WebSocket can't probe a port that doesn't speak HTTP or
TLS, so a native socket library is the only honest way to do this.
- Rewrite probeRelay to:
TcpSocket.createConnection({ host: dnsName, port: 4001 }, () => ok)
on error → 'failed', on wall-clock timeout (5s) → 'failed'
Resolve 'ok' the instant the connect callback fires (TCP SYN-ACK
complete) and destroy() the socket immediately so we don't drag
through the libp2p multistream handshake we can't speak anyway.
The relay closes its side too; both ends settle quickly.
- Wall-clock timeout, not TcpSocket's per-socket timeout. The
per-socket timeout only fires AFTER connect; we need to guard the
connect phase too so a host that silently drops SYNs doesn't hang
the probe forever.
- i18n string updated: "Relays (libp2p reachability on TCP :4001):"
— no more "proxy for libp2p path" weasel-wording.
** REQUIRES NATIVE APK REBUILD ** — react-native-tcp-socket is a
native module. Metro bundle reload is not enough. After pulling
this commit:
- yarn install (pulls 6.4.1 into node_modules)
- cd apps/box && cd android && ./gradlew clean (optional, safe)
- npx react-native run-android (rebuilds APK)
- (iOS, if desired) cd ios && pod install && npx react-native run-ios
Tests: 30/30 Diagnostics jest tests pass. Probe behaviour itself
isn't unit-tested — the jest react-native mock can't fake socket
semantics, and the screen module isn't import-tested (the
component-library transitive deps are jest-hostile, per the
existing skip-snapshot convention). The probe is exercised on the
real device.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments