Chatter3 engineering notes

Measurements · live server

The first 133 calls

What actually happens between two people pressing “Start call”: how long the connection takes, how often the other person never arrives, and what the old measurement counted as conversation.

Taken from the production database on 17 November 2026 · aggregates only, no user data

Read this first: what this data is

These are 133 sessions on a young product with 35 registered accounts, of which 13 people appear in a session. Most of them are the team, the testers and the store reviewers. This is not a market sample and it is not a benchmark — it is a first look at a live system by the people who wrote it, published with its own limits attached so that nobody has to guess what it means.

Everything below is an aggregate. No user id, no name, no address, no timestamp of an individual session.

133
sessions since the first match
114
completed
14
failed
8
ended because the partner never came

How a call ends

Every session carries one reason. Before the split between “the partner never came” and “the network failed”, all nine of the partner‑absence cases were counted as network failures — and the advice about a more stable Wi‑Fi was built on them.

ReasonSessionsWhat it means
no reason recorded73the session ended without a reason being written — mostly the calls that ran their full length
hangup36one of the two people ended the call
peer_not_joined8the other person never pressed “Start call”
early_leave5the call ended before the full length
stale_cleanup4the session was cleaned up after nobody came
network_disconnect1a genuine network failure
cancelled1cancelled before it started

Eight sessions where the partner never arrived, and one real network failure. The product was telling its users to fix their networks nine times out of ten.

How long a call is

This is the table that made us change the code. The durations below are the old ones — measured from the moment the two people were matched, which includes the pre‑call screen and the waiting:

Measured durationSessions
0 s4
1–29 s20
30–59 s36
1–2 min15
2–5 min8
5–10 min14
over 10 min1
no duration recorded16

Two thirds of the calls measured between 30 seconds and two minutes. On a product whose promise is a five‑minute conversation, that is not a believable distribution — and it was not a distribution of conversations. It was a distribution of arrivals: how long it took for both people to get to the same screen.

The fix is in the call clock: the duration now starts when both sides are ready, and the column call_started_at is written by the server in the same statement that records the readiness. The table above cannot be recomputed for the old sessions, because the information they need was never stored — which is why the column was added and why the old rows keep the old number with a note.

How long the connection takes

Twenty‑six sessions recorded a connected event with a measured time to connect. The minimum was 22.1 seconds, the maximum 221.9 seconds, the average 56.0 seconds.

That average is not a connection time, and the number itself is the proof of the bug above. It was measured from the moment of the match, so it contains the waiting for the partner. A connection that takes 56 seconds to establish and a pair that took 50 seconds to arrive look identical in that field.

The same table, counted by session rather than by event, is quieter and more revealing:

ICE candidates sentSessions
by both people3
by one person only2

Five sessions produced candidates at all, and in two of them only one side ever sent one — the signature of the Durable Object that forgot one of the two people. The other end was waiting for a message that was being delivered to a set that no longer contained its socket.

The method

So that the numbers can be checked, here is the query that produced the failure table, and the rule the durations follow:

-- How a call ends
SELECT COALESCE(disconnect_reason,'(none)') AS reason, COUNT(*) AS n
FROM sessions WHERE status IN ('completed','failed')
GROUP BY reason ORDER BY n DESC;

-- How long a call is: from the start of the call, not from the match
export function callDuration(sess: any, now: number = Date.now()): number {
  const raw = sess?.call_started_at || sess?.connected_at || null;
  const ms = parseDbTimestamp(raw);
  if (isNaN(ms)) return 0;
  return Math.max(0, Math.floor((now - ms) / 1000));
}

Three rules are now fixed in the code and in the tests:

  • The server decides when a call starts, in one statement, when both sides have said they are ready. It is not the moment of the match and not the moment the media connected.
  • The clock is the server’s. The browser is told the start time and the server’s own time, so two phones with clocks eleven seconds apart show the same second.
  • A reason is one of a shared list, validated before it is written, and a session carries exactly one of them. The statistics are built from that same list.

What would make this data worth more

The honest answer is: a thousand sessions with a hundred different people in them. The three sessions that already carry a real call_started_at have an average wait of 4.3 seconds between the match and the start of the call — a number from three sessions, which is worth nothing on its own and is only here to show what the column will be able to say once there are more of them.

The measurement is in place. When the numbers are worth quoting, they will be quoted with the same caveat that the number of sessions is a hundred times larger.


← All notes · Practise English for free →