Repository navigation
feat(client): network reports show how connections hold up on each network - #876
Merged
Merged
Conversation
Upstream divergenceBoth sides are compared with upstream at the in-order tip
Upstream files that start to differ (2)
Upstream files whose difference changes (17)
|
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
incognitojam
force-pushed
the
styal/mobile-network-condition-reports
branch
from
October 16, 2026 16:26
72dbb0b to
6a37453
Compare
…twork Clients summarize each environment connection into windows of foreground use, split when the network type or route changes and capped at 15 minutes: time connected, drops, failed attempts, reconnect time, heartbeat round trips, and data received and sent. Round trips come from the existing RPC heartbeat, so measuring adds no traffic. Reports name the network type and route kind only, never a network or carrier name. Servers that advertise `networkReports` record each report as `client.network.report`, dated when its window ended. Mobile keeps reports for 7 days and lists them under Settings → About → Diagnostics.
Each window now splits drops by cause: heartbeats unanswered (the client closed the socket), socket closed, and health check timed out. It counts failed attempts that ran out of setup time, switches to a different route without a failure, and switches back after the switched-to session failed. These replace the separate heartbeat timeout count.
A report now carries the duration of each reconnect, up to 20 per window, instead of the window's median and slowest. Dashboards can then take exact reconnect percentiles across many windows. Mobile shows a reconnect even when its drop fell in the previous report.
incognitojam
force-pushed
the
styal/mobile-network-condition-reports
branch
from
October 17, 2026 14:59
2b6b699 to
f0c689c
Compare
incognitojam
marked this pull request as ready for review
October 17, 2026 15:16
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.
Note
Clients now summarize how each connection behaves on each network type: time connected, drops and why, reconnect time, heartbeat round trips, data, and route switches. Mobile lists them under Settings → About → Diagnostics, and servers record them as
client.network.reportso a dashboard can show whether styal holds up on trains and weak cellular. Reports name the network type, never the network. No native modules, so mobile ships by OTA.We had no way to tell how styal behaves on a train or a weak signal. Nothing on the client measured round trips, drops, reconnect time or data, and relay traces only cover T3 Connect attempts. Upstream has no client-side connection measurement either (checked against pingdotgg/t3code main at cfafb4b).
What it measures
packages/client-runtime/src/networkReportsfollows every environment connection in web, desktop and mobile and splits it into windows of foreground use, at most 15 minutes, starting a new one when the network type or route changes. Each window records:The socket meter shares the RPC session's WebSocket constructor wrapper with the received-frame counter from pingdotgg#19426.
A drop is a session that fails after answering in the foreground. A socket the OS closed while the app was in the background is found on return and counts toward the time to a working connection instead, so every reopen does not read as a network failure. On mobile, network type changes wait 1.5 s and then read the state afresh:
expo-networkbriefly reports "none" during a Wi-Fi/cellular handover.Reports carry the network interface type (Wi-Fi, cellular, ethernet, VPN, none) and route kind (styal Link, LAN, Tailscale, public, SSH). They never include network or carrier names, addresses, location, or environment identifiers. Connections to the same device are not reported, so the desktop app's own server adds nothing.
Where reports go
networkReportscapability and acceptserver.reportNetworkConditions. Each report becomes aclient.network.reportevent with the connection's client dimensions, dated when its window ended, so reports sent after a dead zone land in the period they describe.T3CODE_TELEMETRY_ENABLED=falsestill stops them.navigator.connection, which only Chromium on Android provides. Reports are kept in memory only.Validation
Android emulator (pixel_7_api_37_b, styal Dev) against an isolated dev server seeded from real data, with PostHog pointed at a local collector:
Unit tests cover window splitting, drop causes, route switches, delivery (sent once, kept on device for servers without the capability, restored from storage), the backdated analytics event, and the mobile wording. The mobile native fingerprint is unchanged: no native modules were added, and none of the changed files is among the fingerprint inputs, so mobile ships by OTA.
The Connection reliability by network dashboard in PostHog splits connected share, drops per foreground hour by cause, reconnect p50/p95, round-trip p50/p95 and route switches by network type and route kind. Its queries run against the event and stay empty until a release ships it.
docs/operations/observability.mdlinks to it.Not verified: iOS, the web client in a browser, and a styal Link route (the emulator ran against a dev server with LAN and Tailscale routes only).
Written by an agent (Claude Code, claude-opus-5-5).