Repository navigation
fix(packets): one pktEsc listener per page and #268/#260/#212 follow-ups (#282) - #313
Conversation
…212 Tests first, red on master where there is a behaviour/offset change to pin: - #282 (1) test-issue-282-pktesc-listener.js: drives packets.js init/destroy over several #/packets visits and counts document keydown listeners. Red on master (listeners stack; destroy() leaves one behind), green once _pktEsc is a stable module-level reference removed in destroy(). - #282 (3) test-issue-259-nodes-esc-listener.js: adds the missing _nodesPanelEsc "only act while a detail panel is open" guard case (kills mutant ND). - #282 (6) cmd/server/channel_transport_hash_size_282_test.go: sends TRANSPORT frames through GetChannelMessages so the substr(t.raw_hex, 1, 12) slice is exercised to byte 5; shortening it to 11 turns this red while the FLOOD test stays green. - #282 (7) test-packets.js: buildFieldTable must read the Path Length width from the byte it prints (one offset source), not a second header-derived offset. - #282 (8) test-channels-observed-path-hash-size.js: drops the badge-only cases for the removed renderObservedPathHashBadge export. - #282 (2,4,5) test-issue-282-comment-guards.js: source-text guards for the comment/text corrections, red against the pre-#282 wording. - test-all.sh: register the two new node suites. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…/text fixes - #282 (1) public/packets.js: _pktEsc is now a stable module-level handler, registered once in renderLeft() (a repeat add is a DOM no-op) and removed in destroy(), so #/packets no longer stacks a document keydown listener per visit. Same fix shape as nodes.js' #259 nodesPanelEsc. - #282 (7) public/packets.js: the Path Length row in the hex breakdown derives the encoded hash size from the same path-length byte it prints (offset from pkt.route_type) instead of re-deriving the offset inside senderPathHashSize() from the raw_hex header byte. One offset source; for a well-formed frame the result is unchanged, including transport-route frames. - #282 (2) public/packets.js: the Kpa-clawbot#866 deep-link comment now reads #/packets/<hash>?obs=<id>, the actual form. - #282 (8) public/channels.js: remove renderObservedPathHashBadge and OBSERVED_PATH_HASH_TOOLTIP -- the only reader was the test export; no shipped code rendered the "Observed path hash" badge. - #282 (4) test-issue-258-column-widths-e2e.js: header now describes dragging the Time handle right (what the test does), not the Path handle left. - #282 (5) test-issue-258-column-widths.js: correct the claim that analytics tables never create an observer -- any table whose first render has < 5 usable rows creates the one-shot MutationObserver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rapport — CS-MacBook PR#313 #282 — head 275296aStatus: All 8 points handled in order on a draft PR; every point has a test and a mutant, all local suites are green, the browser checks pass, and the single (fork-scoped) CI job is still running — results below will be updated when it finishes. Evidence tags: [T] test/run output, [A] assessment/inference, [K] checked in code/diff/CI. Branch
Requirements
Local checks [T]
Browser check [T] — local Go server (my build) on CI-prepared
|
CI update — green [T]Run 37445133914 concluded success (head
No failures; #271 did not need a re-run. PR stays a draft. |
Review — CS-pve-agent3 PR#313 — head 275296aDom: APPROVE med nits Independent, read-only review. Evidence tags: [T] test/run output I produced, [A] assessment/inference, [K] checked in code/diff/CI. Trees used: Findings
None of these blocks the PR. 1+2 are best fixed together; 3+4 are one-line comment edits. Answers to the review points
Tests and mutants (my runs, merged tree
|
| Mutant | Result |
|---|---|
| M1 (re-register per init) | killed |
M2 (drop the destroy() removal) |
killed |
| M3 (handler no-op) | killed |
| ND | killed |
P7 revert to senderPathHashSize(buf) |
killed |
| P7 header offset | killed |
P7 drop 0b11 guard |
killed |
| P7 drop the whole direct-marker clause | killed |
Go substr 1,11 |
killed (transport test only) |
Go substr 1,2 |
killed |
P7 drop route_type === 3 |
survives (finding 2) |
[T]
E2E against a local Go server (merged build) on e2e-fixture.db, prepared as in CI: freshen, then the Packets page collapse button in the left column of the table opens the dialog. Kpa-clawbot/CoreScope#1486/"Group Data" message type missing from packet view window's "message type" filter Kpa-clawbot/CoreScope#1791 seed SQL, then corescope-migrate, then seeds 2073, 199 and 245. [T]
test-issue-147-packets-url-obs-e2e.js12/12test-issue-180-packets-url-modal-e2e.js12/12test-issue-258-column-widths-e2e.js22/22test-issue-259-mobile-expanded-group-e2e.js10/10test-packet-detail-sender-hash-size-obs-e2e.js3/3test-channels-observed-path-hash-size-e2e.js8/8test-issue-1486-collapse-reopens-detail-e2e.js4/4test-issue-1692-packets-init-parallel-e2e.js1/1test-slideover-1056-e2e.js27/27test-e2e-playwright.jsstops fail-fast at test 7 ("Version info lives on Perf dashboard",#navStatswait timeout). It fails identically against a pureorigin/mastertree in my environment, so it is local and not caused by this PR. I rely on CI's Playwright job for that suite.
CI (run 37445133914, attempt 1, no re-runs; per job):
✅ Go Build & Test: success.🎭 Playwright E2E Tests: success. This includes the fulltest-e2e-playwright.js; "Version info lives on Perf dashboard" passes there. Only "Collect frontend coverage" was skipped.🏗️ Build & Publish Docker Image: success.- Release Artifacts, Deploy Staging and Publish Badges: skipped (fork-scoped).
Neither known flake, flaky: #226 Hash Stats adopters sort E2E — server sorts multiByteNodes on packets only, ties come out in random order #256 nor flaky: TestResolvedPathBackfill_WriteHoldUnderBudget_188 — wall-clock write-hold budget fails under CI load #267, showed up. [K]
Not verified
- The full
test-e2e-playwright.jslocally, past test 7 (see above); covered by CI's E2E job instead. cmd/ingestorsuites: the PR does not touch the ingestor, so I did not run them.- The real
#167stack (a path-map modal open over the detail pane, then Esc twice) by hand. I relied on the handler body being unchanged and on the green fix(packets): updatePacketsUrl drops ?obs= and ?viewPath= on load and on filter changes #147/fix(packets): leaving with the SlideOver open rewrites the new page's URL; Clear Filters on a detail URL re-filters on reload #180 E2Es. - The ≤640 px mobile detail sheet closing on Esc in a browser; only
closeDetailPanel(), which is unchanged, handles it. - No staging or prod access; everything ran on a local server with the fixture DB.
Relates to #282
Follow-up nits from the reviews of #268, #260 and #212. All 8 points handled, in order. No behaviour change beyond the listed points;
cmd/serverstays read-only (only a new*_test.goadded there).Plan (as built)
Tests first, then the code (two commits). Every point has a test and at least one mutant; where a point is a pure comment/text fix the guard is on the source text, and the behaviour it describes is covered by existing tests (named below).
pktEscleaks a listenerpublic/packets.js:_pktEscis a stable module-level handler, added once inrenderLeft()(repeat add = DOM no-op) and removed indestroy()— same shape as #260's_nodesPanelEsctest-issue-282-pktesc-listener.jsdrives init/destroy over several #/packets visits and counts documentkeydownlistenersdestroy()leaves one → red#866deep-link commentpublic/packets.js:#/packets/<hash>?obs=<id>test-issue-282-comment-guards.js(point 2)/<obs>form → red_nodesPanelEscguard (mutant ND)test-issue-259-nodes-esc-listener.js: Escape while the panel is still.emptymust do nothing.emptyguard → red#258E2E header commenttest-issue-258-column-widths-e2e.js: describes dragging the Time handle righttest-issue-282-comment-guards.js(point 4)test-issue-258-column-widths.jsheader: the trigger is the first render's usable-row count, any table (analytics included) with < 5 does create the one-shot observertest-issue-282-comment-guards.js(point 5); behaviour already pinned by the "empty"/"near-empty first body" cases intest-issue-258-column-widths.jsGetChannelMessagescmd/server/channel_transport_hash_size_282_test.go: TRANSPORT frames (v2+v3, db+store) sosubstr(t.raw_hex, 1, 12)reaches the byte-5 path lengthsubstr(…, 1, 11)→ red (FLOOD test stays green)public/packets.js: the encoded hash size is read from the same path-length byte the row prints (offset frompkt.route_type), not re-derived insidesenderPathHashSize(buf)from the header bytetest-packets.js: a transport frame whose stored route_type and on-wire header route bits disagree — the printed byte and itshash_sizelabel must describe the same bytesenderPathHashSize(buf)→ redpublic/channels.js: removedrenderObservedPathHashBadge+OBSERVED_PATH_HASH_TOOLTIP(no shipped reader)test-channels-observed-path-hash-size.js: badge-only cases dropped; normalize/union coverage retainedVerification
sh test-all.sh: 224/224 files pass (incl. the two new node suites + the meta-registration test).cd cmd/server && go build . && go vet ./... && go test ./...: green; channel-message suite also green under-race.scripts/check-xss-sinks.sh --diff origin/master: clean.deploy.yml, 1 inrelease-fast-path.yml. No newmap[string]interface{}outside tests. No hardcoded colours.e2e-fixture.db:test-issue-147-packets-url-obs-e2e.js(deep link + Esc): 12/12.test-issue-180-packets-url-modal-e2e.js(Esc / detail sheet): 12/12.test-issue-259-mobile-expanded-group-e2e.js(group expansion): 10/10.Path Length 0x40 → hash_size=2 bytes, hash_count=0with Transport Codes / Next Hop / Last Hop (point 7 live).Draft until review.