Skip to content

Count held-chat relay writes by sender, not by path - #2428

Merged
santoshkumarradha merged 3 commits into
app/v3from
c27/heldchat-by-sender
Nov 5, 2026
Merged

santoshkumarradha merged 3 commits into
app/v3from
c27/heldchat-by-sender

Conversation

@santoshkumarradha

Copy link
Copy Markdown
Member

What changes

#2425's suffix filter would let a real P2 heartbeat to P1's cell pass; this counts by sender instead.

TestTheFreshChatBesideAHeldOneWorksOnItsOwnSeat checks that P2, the computer that does not hold the chat, never writes to P1's held relay cell. #2425 stopped counting any request whose path ends in /heartbeat. That hid P1 renewing its own lease, but it also hid any heartbeat P2 might send.

This PR changes only the test fixture. A test-only transport marks each simulated computer's requests as P1 or P2. The relay counts every non-GET that P2 sends to P1's cell or its subpaths, whatever the operation. The assertion "P2 made N writes to P1's relay cell; want 0" is unchanged. Product code is not touched.

Tests

To check the assertion, I temporarily injected one P2 heartbeat to P1's cell, with P1's lease fence, after P2's fresh-chat turn:

Fixture With the injected P2 heartbeat Without it
app/v3, with #2425's suffix filter ok: the crossing write goes unnoticed ok
This PR, counting by sender FAIL heldchat_drive_test.go:406: P2 made 1 writes to P1's relay cell; want 0 ok

The gate:

  • The held-chat test, run 20 times.
  • Full runs of cmd/codeaf, internal/cellsync, internal/syncsetup and the packages that import them (a full make test).

🤖 Generated with Claude Code

santoshkumarradha and others added 3 commits November 5, 2026 14:40
#2425 stopped counting requests whose path ends in /heartbeat, so a real
heartbeat from P2 to P1's held cell would pass unnoticed. The fixture now
marks each simulated computer's requests and counts every non-GET P2
sends to P1's cell, whatever the operation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@santoshkumarradha
santoshkumarradha merged commit 11782a9 into app/v3 Nov 5, 2026
@santoshkumarradha
santoshkumarradha deleted the c27/heldchat-by-sender branch November 5, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant