Skip to content

fix(packets): node and observer filter races - #599

Merged
dborup merged 1 commit into
masterfrom
fix/595-packets-filter-races
Oct 25, 2026
Merged

dborup merged 1 commit into
masterfrom
fix/595-packets-filter-races

Conversation

@dborup

@dborup dborup commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Relates to #595

Plan / what this does

Audit of the two upstream changes (read only) against our Packets page:

Upstream change Our fork before this PR Action
Node filter pick on slow click / late search result Same race: suggestions select on click while blur hides the list after 200 ms; no guard against late /api/nodes/search responses Fixed: select on mousedown with preventDefault; sequence counter drops stale responses, bumped on every search and on pick
Observer filter re-fetch Already fixed here: the observer menu handler calls loadPackets(), and loadPackets drops stale responses via packetLoadGeneration No code change; locked in with E2E tests

Adapted, not cherry-picked: the E2E lives at the repo root and is registered in scripts/e2e-shards.json (shard 1), matching our layout.

Tests

test-issue-595-packets-filter-races-e2e.js (Playwright, route interception, held responses released explicitly, no sleeps for outcomes):

  1. Node: normal click applies the pick.
  2. Node: press held past the blur delay applies the pick.
  3. Node: late search response neither drops the pick nor reopens the list.
  4. Observer: ticking an observer issues /api/packets?observer=.
  5. Observer: a slow response for an earlier selection does not overwrite the later "All Observers" view.

Cases 2 and 3 fail on master and pass with the fix. Cases 4 and 5 pass on master (already fixed) and fail under mutants.

Perf

No new requests or loops. One integer counter per node search; the observer path is unchanged.

Not done

  • Customizer: no new configurable values.
  • Go packages not run separately (no Go changes); sh test-all.sh passes, 273 files.

🤖 Generated with Claude Code

…sponse

Relates to #595

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dborup

dborup commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Rapport — CS-Minimax PR#599 #595 — head 5946944

Status: Draft PR ready for review; all CI jobs green, no remaining failures.

Point 1 — Node filter: slow press and late search response (upstream 2244)

Case Test Master Fix Mutant
Normal click applies the pick test-issue-595-packets-filter-races-e2e.js pass pass n/a
Press held past the 200 ms blur delay same file fail pass M2: back to click → red [T]
Late search response must not drop the pick or reopen the list same file (held via route interception) fail pass M1: sequence guard removed → red [T]

Point 2 — Observer filter re-fetch (upstream 2242)

Case Test Master Fix Mutant
Ticking an observer issues /api/packets?observer= same file pass (already fixed in our fork) pass M3: loadPackets() → renderTableRows() → red [T]
Slow response for an earlier selection must not overwrite "All Observers" same file pass pass M4: packetLoadGeneration guard removed → red [T]

No code change for point 2; the fork already re-fetches and guards stale responses. The tests lock that in. [A]

Checks

  • sh test-all.sh: 273 passed, 0 failed. node test-frontend-helpers.js: 725 passed. [T]
  • New E2E: 5/5 against a local Go server on the migrated, freshened e2e-fixture.db. [T]
  • scripts/check-xss-sinks.sh --diff origin/master: clean. No workflow files changed, so the fork guards are untouched. No Go changes, so no new map[string]interface{} and cmd/server stays read-only. [A]
  • The suite is registered in scripts/e2e-shards.json (shard 1). [K]

CI per job (run 40198218316)

All pass: Go Build & Test, Go Ingestor, Go Libraries & CLI, Go Server 1/3, 2/3, 3/3, JavaScript Unit Tests & Lint, Script & Container Unit Checks, Playwright E2E 1/3, 2/3, 3/3, Validate Docker Image, Verify E2E Shards & Coverage, Verify Go Test Assignments, Build & Publish Docker Image. Skipped as expected: Publish Badges, Release Artifacts, Deploy Staging. No reruns needed; #271 did not trigger. [T]

Remaining

  • Not run: the full test-e2e-playwright.js locally; CI covers it. [K]
  • live.js still has its own node-autocomplete implementation (out of scope). [A]

@dborup
dborup marked this pull request as ready for review October 25, 2026 14:25
@dborup
dborup merged commit 02c7fe9 into master Oct 25, 2026
18 checks passed
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