oficina / meet Public

Browser gate: chat waits for A's own echo as it waits for B's line

A's echo lands when A's POST is answered and B's line when the hub's
broadcast reaches B: no order between them. Reading A's log the moment
B had the line failed 1 run in 6 on main f5a1254 and here alike; 0 in
8 with the same two seconds B gets.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev fbf39b699030e00f9d9a1c47173625d5c0b4584b parent 346ea0e
1 file changed, +7 −1
  • test/browser/call.mjs +7 −1

CI passed — run details

CI log
=== vet ===
go vet ./...
=== fmt ===
=== test ===
go test ./...
ok  	amadan.net/oficina/calls/callscore	(cached)
?   	amadan.net/oficina/calls/cmd/calls	[no test files]
ok  	amadan.net/oficina/calls/internal/calls	1.566s
ok  	amadan.net/oficina/calls/internal/calls/apns	(cached)
ok  	amadan.net/oficina/calls/internal/calls/hub	(cached)
?   	amadan.net/oficina/calls/internal/calls/icons	[no test files]
ok  	amadan.net/oficina/calls/internal/calls/relay	(cached)
ok  	amadan.net/oficina/calls/internal/calls/seal	(cached)
ok  	amadan.net/oficina/calls/internal/callstest	(cached)
?   	amadan.net/oficina/calls/protocol	[no test files]
?   	amadan.net/oficina/calls/scripts/writeestilo	[no test files]
=== migration-check ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo migration check
rastrillo migration check: models and migrations agree
=== race ===
CGO_ENABLED=1 go test -race ./internal/...
ok  	amadan.net/oficina/calls/internal/calls	10.292s
ok  	amadan.net/oficina/calls/internal/calls/apns	(cached)
ok  	amadan.net/oficina/calls/internal/calls/hub	(cached)
?   	amadan.net/oficina/calls/internal/calls/icons	[no test files]
ok  	amadan.net/oficina/calls/internal/calls/relay	(cached)
ok  	amadan.net/oficina/calls/internal/calls/seal	(cached)
ok  	amadan.net/oficina/calls/internal/callstest	(cached)
diff --git a/test/browser/call.mjs b/test/browser/call.mjs
index bd72271..00fe3c8 100644
--- a/test/browser/call.mjs
+++ b/test/browser/call.mjs
@@ -3261,7 +3261,13 @@ const run = {
check(heard.self === false, "the line B sees is not drawn as B's own");
}
- const echo = (await chatLog(pageA)).find((l) => l.text === HELLO);
+ // A's echo is appended when A's own POST is answered, and B's line
+ // when the hub's broadcast reaches B's stream: two different events
+ // with no order between them. Reading A's log the instant B had the
+ // line raced that, and lost about one run in six on main f5a1254 as
+ // on this branch (#24). The claim is unchanged — A's log shows what A
+ // said — and it gets the same two seconds B's does.
+ const echo = await until(async () => (await chatLog(pageA)).find((l) => l.text === HELLO) || false, 2000);
check(echo, "A's own log shows what A said (" + JSON.stringify(await chatLog(pageA)) + ')');
if (echo) check(echo.self === true, "A's echo is drawn as A's own line");