Skip to content

fix(capture): ignore terminal EventSource 204 aborts - #359

Merged
BenSheridanEdwards merged 1 commit into
mainfrom
codex/fix-eventsource-204-residue
Aug 11, 2026
Merged

fix(capture): ignore terminal EventSource 204 aborts#359
BenSheridanEdwards merged 1 commit into
mainfrom
codex/fix-eventsource-204-residue

Conversation

@BenSheridanEdwards

Copy link
Copy Markdown
Owner

Why does this feature exist?

Chromium can emit a successful HTTP 204 response followed by requestfailed(net::ERR_ABORTED) when an EventSource is intentionally told not to reconnect. StyleProof treated the later browser event as failed data residue, so a clean capture could be blocked despite the stream reaching its protocol-defined terminal state.

What changed?

  • Track residue observations by Playwright request identity until readout.
  • Treat only an EventSource HTTP 204 as terminal, clearing a failure observation for that same request regardless of browser event order.
  • Keep fail-closed behavior for aborts without a terminal response, interrupted HTTP 200 streams, non-EventSource HTTP 204 responses, and all HTTP 4xx/5xx responses.
  • Add deterministic unit coverage, a real Chromium regression test, reviewer-facing proof, and a changelog entry.
  • No dependency, configuration, baseline format, or public API changes.

Behavioural Proof (with video and screenshots)

  • Video: Not applicable — this changes browser network-event classification and has no motion or interactive UI behavior.

  • Screenshots:

    Playwright report showing the EventSource HTTP 204 regression passing

  • Behaviour tests:

    Red before the implementation:

    not ok 4 - an EventSource HTTP 204 terminal response is clean when Chromium later reports ERR_ABORTED
    expected: []
    actual:   [{ key: 'dashboard·/api/stream', reason: 'net::ERR_ABORTED' }]
    

    Green after the implementation:

    node --test test/data-residue.test.mjs
    tests 13
    pass 13
    fail 0
    
    npx playwright test test/data-residue.e2e.spec.ts
    4 passed
    
    npx playwright test test/data-residue.e2e.spec.ts --grep 'EventSource terminal HTTP 204' --repeat-each=100
    100 passed
    

Verification Summary

  • Definition of Done: followed .agents/project/DEFINITION_OF_DONE.md.
  • Commands run:
    • npm run build && npm run typecheck && npm run lint && npm run format:check
    • npm run privacy:check
    • npm test
    • npm run test:e2e
    • npm run demo:report && npm run demo:check
    • npm audit --audit-level=high
    • npm pack --dry-run --json
    • focused Chromium regression repeated 100 times
  • Results: all passed; 675 unit tests, 122 full browser tests, 100/100 focused Chromium repetitions, zero high-severity audit findings, and a clean package dry run.
  • Known risks or skipped checks: the exception is deliberately narrow to EventSource HTTP 204 on the same Playwright request. Actual stream failures remain fail-closed. No checks were skipped.

Checklist

  • Proof above — linked the regenerated docs/demo/report.md, or pasted the command/test output that demonstrates the change
  • If you changed capture/diff/report rendering, ran npm run demo:report and committed docs/demo/
  • npm run build && npm run typecheck && npm run lint && npm run format:check pass
  • npm test passes (and npm run test:e2e if the capture/engine path changed)
  • Added/updated tests for the change
  • Updated the README / CHANGELOG if behaviour or the public API changed
  • If captured output changed, noted that adopters must regenerate baselines — captured output and baseline format are unchanged
  • Followed .agents/project/DEFINITION_OF_DONE.md and .agents/skills/pr-inline-screenshot-proof/SKILL.md
  • Screenshots are committed and embedded inline with ![alt](...png?raw=1), or the proof section says Not applicable with the technical reason
  • The PR body has no bare screenshot links, local paths, relative paths, or proof placeholders

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Note

Synthetic action dogfood receipt. This report is the final deliberately failing fixture in the action contract suite. It proves that unproven evidence is rejected; it does not certify this pull request.

🗺️ StyleProof report

📊 View the side-by-side visual report →


Coverage, determinism, or report/diff consistency evidence is incomplete — repair the capture or reflow source; reviewer approval cannot clear this failure.

@BenSheridanEdwards
BenSheridanEdwards merged commit f3cb866 into main Aug 11, 2026
12 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