Repository navigation
Count held-chat relay writes by sender, not by path - #2428
Merged
Merged
Conversation
#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]>
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.
What changes
#2425's suffix filter would let a real P2 heartbeat to P1's cell pass; this counts by sender instead.
TestTheFreshChatBesideAHeldOneWorksOnItsOwnSeatchecks 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:
ok: the crossing write goes unnoticedokFAIL heldchat_drive_test.go:406: P2 made 1 writes to P1's relay cell; want 0okThe gate:
cmd/codeaf,internal/cellsync,internal/syncsetupand the packages that import them (a fullmake test).🤖 Generated with Claude Code