Skip to content

test: discard truncated SSE events on end-of-stream and abrupt disconnect - #26

Closed
hamid-digitalmarketer wants to merge 1 commit into
VOLPAROSSA:mainfrom
hamid-digitalmarketer:fix/issue-25-truncated-sse-event
Closed

hamid-digitalmarketer wants to merge 1 commit into
VOLPAROSSA:mainfrom
hamid-digitalmarketer:fix/issue-25-truncated-sse-event

Conversation

@hamid-digitalmarketer

@hamid-digitalmarketer hamid-digitalmarketer commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Central maintenance — 2026-11-05: Integrated as #29 with the original author's attribution, LF formatting, bounded test lifetime and a verified partial-byte arrival before abrupt disconnect. All 11 focused tests and hosted source checks pass. The connector could not update this contributor fork (403), so the corrected integration used an organization branch. Original contribution and discussion are retained below.

Regression tests for truncated SSE events (Closes #25).

Adds three tests to tests/opencode-client.test.cjs verifying the intended fail-closed behavior:

  • A truncated SSE event followed by normal end-of-stream is discarded, the client closes, and no event is emitted.
  • A complete event is emitted exactly once when a truncated event follows it at end-of-stream.
  • An abrupt disconnect (destroying the test-owned response) after a truncated event has the same no-partial-event and cleanup expectations.

All 11 tests in the file pass (node --test). Tests-only PR; no runtime protocol change.

Direct contact: WhatsApp +923167417135 (contact only, no spam).

…nect (VOLPAROSSA#25)

Regression tests covering the intended fail-closed behavior for a truncated SSE event: no partial event is ever dispatched, the client closes and becomes non-ready, and a complete event preceding the truncated one is emitted exactly once. No runtime code change.

Direct contact: WhatsApp +923167417135 (contact only, no spam).
Aaqibhafeezkhan pushed a commit to Aaqibhafeezkhan/volparossa-code that referenced this pull request Nov 6, 2026
Preserve the contribution from PR VOLPAROSSA#26, restore LF-only formatting, bound test lifetime and observe partial client bytes before the abrupt disconnect.

Co-authored-by: Muhammad Hamid <hamidbloger1@gmail.com>
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.

test: discard incomplete OpenCode SSE events on stream termination

2 participants