Skip to content

refactor(tui): extract event stream connection - #38872

Merged
jlongster merged 4 commits into
v2from
client-connect
Jul 27, 2026
Merged

refactor(tui): extract event stream connection#38872
jlongster merged 4 commits into
v2from
client-connect

Conversation

@jlongster

@jlongster jlongster commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • extract one event stream connection attempt from the reconnect loop
  • pass only the stream AbortSignal into the extracted function
  • separate request setup, handshake, connected-state publication, event forwarding, and cleanup
  • leave reconnection, backoff, and service resolution in start()

Behavioral equivalence

  • run the same 16-test characterization harness against untouched origin/v2 and this branch
  • cover 20 behavior areas including handshake ordering, delivery, logs, errors, timeout, reconnects, cleanup, cancellation, service replacement, listener failures, malformed SSE, and attempt reset
  • produce byte-identical 828-line, 17,399-byte transcripts for both implementations
  • matching SHA-256: 561bd5a1e22eca7c9821b293920308c4487fadc9751b0ca4a6e41cd3f21bb36b

Testing

  • bun test test/cli/tui/client-connection-characterization.test.tsx
  • bun test test/cli/tui/use-event.test.tsx
  • bun typecheck

@jlongster
jlongster merged commit 4e4cf9e into v2 Jul 27, 2026
10 checks passed
@jlongster
jlongster deleted the client-connect branch July 27, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant