A sent message should show at once and the reply should arrive as it is written
In progress. The bubble-on-tap change and the forward read are open pull requests.
Sent messages should show at once, and replies should cost only what is new
Status: in progress. Two changes are open for review and the numbers so far are from the clean link only. The tests on the slow links are still running.
Today a sent message shows up about a quarter second after you tap, and the words sit in a greyed box until then (M). On a slow link it should be worse (C). A new reply line makes the phone download about 51 KB of history again (M).
The phone already saves every sent message in its outbox first, so nothing is lost if the link fails. The message bubble can come straight from the outbox, with no wait for the machine.
The tiles are the starting point. The sections below explain where each number comes from and what changes.
Three waits sit between your tap and the message appearing
We read the code for what happens after the tap. Three things delay the bubble, and a fourth hides it:
- A wait of up to 1 secondThe phone first waits for an unsent draft edit to finish. On a slow link that edit is usually still in flight (G, from reading the code).
- A label that says the wrong thingThe row says Saved on this device, waiting for connection, even while it is sending.
- The row vanishes, then returnsWhen the machine answers, the outbox row is deleted. It comes back only after a full re-read.
- The words stay in the boxThe box stays full and disabled until the machine answers, which can take up to 20 seconds.
The fix is mostly re-ordering, not a new system. Draw the row first, empty the box, and then wait. Keep the row until the machine's own record has the same id, so it never blinks away.
With the link blacked out for 30 seconds before the tap, the message appeared only 30.5 seconds later, with the words still stuck in the box (M).
Each new reply line makes the phone download the whole recent history
The daemon sends the phone a nudge, "something changed", with no text in it. The phone then re-reads the last 200 events, because a change in the last line changes the whole tail. How big is that for one line?
Show as table
| KB | |
|---|---|
| A 200-byte line | 53 |
| A 4 KB line | 57 |
| A 40 KB line | 107 |
Measured on the clean link. The slow-link rows are still running.
A tiny 200-byte line costs 53 KB, 265 times its size (C). A 20-line turn cost 1,276 KB. After a 30-second blackout, all 10 missed lines (23 KB) appeared 2.0 seconds after the link returned, but 554 KB was resent, 24.3 times what was missed (M).
The fix is a forward read: the phone asks only for records after the last byte it already has. The daemon answers with whole records and says where it ended. A stale file token gets a clear "start over" answer.
Five pull requests remain, and one idea was dropped for something better
The plan started with six pull requests. It changed once, because the harness-link design arrived.
| Piece | What it does | Status |
|---|---|---|
| Measure first | Chat rows in the slow-link rig | Clean link done, rest running |
| Bubble on tap | Message shows at once and stays | Open for review |
| Agenda labels | Sending and Sent wording | Not started |
| Forward read | Read only what is new, by byte | Open for review |
| Reply stream | A separate socket for reply text | Dropped |
| After numbers | Re-run the same rows | Waiting |
The bubble-on-tap change is pull request 2777. The forward read is pull request 2778. Both are open for review. The forward read also needs a security review, because its route reads masked content.
The separate reply stream was dropped. The harness-link design carries replies on one sync stream per phone instead, and reuses the forward read as its cursor.
Replies still arrive record by record, not word by word
Predicted gains (C): a new line should reach the phone in about 1 second instead of about 5 on the middle link, and about 1.8 seconds instead of about 16 on the worst link.
Those are computed from the link speeds and a guessed 100 KB tail (the measured tail is about 51 KB), not measured. The reply gains also need the harness-link sync stream, which is not built. The two open pull requests cover the send rows and the forward read only.
The agent writes its transcript one whole record at a time. So reading the transcript can give record-by-record text, never word-by-word. Word-by-word streaming needs the protocol channels from the harness-link design. The wire format leaves room for it later without a change.
What we did not test is just as important:
- The send and reply rows on the middle and worst links: still running.
- A real phone on a real network.
- Several phones watching one ferret at once, which repeats the same work (a known cost).