Skip to content

Migrate transport onto omnyhub 1.1.0 (FrameConnection)#108

Merged
gmpassos merged 3 commits into
masterfrom
feature/omnyhub-migration
Jul 12, 2026
Merged

Migrate transport onto omnyhub 1.1.0 (FrameConnection)#108
gmpassos merged 3 commits into
masterfrom
feature/omnyhub-migration

Conversation

@gmpassos

Copy link
Copy Markdown
Contributor

Migrates OmnyShell's transport onto omnyhub 1.1.0, so the two packages share one connection/TLS stack instead of maintaining parallel WebSocket adapters.

What changed

  • New FrameConnection (lib/src/infrastructure/transport/frame_connection.dart): an OmnyShellConnection backed by an omnyhub Connection wrapped in TypedConnection<OmnyShellFrame>. A small _FrameConnectionCodec implements ConnectionCodec<OmnyShellFrame> adapts OmnyShell's FrameCodec — control↔TextMessage, data↔BinaryMessage. Undecodable inbound frames are dropped rather than tearing the link down.
  • Hub listener (ws_server_endpoint.dart): OnConnection now yields OmnyShellConnection, produced via FrameConnection.fromChannel.
  • Client dials (io_connection_factory.dart, transport_factory_io.dart, node_runtime.dart): dial through FrameConnection.connect over omnyhub's WebSocketConnection.
  • Deleted the hand-written dart:io adapter web_socket_connection.dart.
  • Unchanged: the protocol/broker core (frames, control messages, channels, broker, runtimes, tunnels) and the browser transport WsChannelConnection (omnyhub transport is VM-only).
  • pubspec.yaml: add omnyhub: ^1.1.0; bump to 1.55.0 + CHANGELOG.

Testing

  • Full suite green: 802 passed, 9 skipped — including the wss / TLS-dir / e2e / TestCluster integration tests (behavioral regression gate).
  • New test/unit/transport/frame_connection_test.dart: codec mapping (control→text, data→binary), inbound decode round-trip, drop-undecodable-without-teardown, and close().
  • dart format / dart analyze --fatal-infos --fatal-warnings / dependency_validator clean.

Depends on published omnyhub: ^1.1.0. Please verify — do not merge yet.

🤖 Generated with Claude Code

Replace the hand-written dart:io WebSocket adapter (WebSocketConnection)
with FrameConnection: an OmnyShellConnection backed by an omnyhub
Connection wrapped in a TypedConnection<OmnyShellFrame>. OmnyShell's
FrameCodec is adapted to omnyhub's ConnectionCodec, mapping control<->text
and data<->binary frames; undecodable inbound frames are dropped without
tearing the link down.

- lib/.../transport/frame_connection.dart: new FrameConnection +
  _FrameConnectionCodec adapter (wrap/fromChannel/connect).
- ws_server_endpoint.dart: OnConnection now yields OmnyShellConnection,
  produced via FrameConnection.fromChannel.
- io_connection_factory.dart, transport_factory_io.dart: dial via
  FrameConnection.connect.
- node_runtime.dart: OmnyShellConnection field; dial via FrameConnection.
- delete web_socket_connection.dart; the web WsChannelConnection is
  unchanged (omnyhub transport is VM-only).
- pubspec: add omnyhub ^1.1.0. Bump to 1.55.0 + CHANGELOG.

The protocol/broker core and browser transport are untouched. Full suite
green (802 pass, 9 skipped), including wss/TLS-dir/e2e/TestCluster; new
frame_connection_test covers codec mapping, drop-undecodable, and close.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

gmpassos and others added 2 commits July 11, 2026 22:37
The existing FrameConnection unit test drives a fake connection, so it never
proves the omnyhub transport puts control frames on the wire as WebSocket
*text* frames and data frames as *binary* frames — the one thing that would
silently corrupt every session if it were wrong. Add an integration test that
binds a real TLS WsServerEndpoint, dials it with FrameConnection.connect and
asserts:

- a control frame arrives as a ControlFrame (text path).
- a data frame with non-UTF-8 bytes survives byte-for-byte (binary path;
  the core regression).
- the server can push a data frame back to the client.
- a ~60 KiB binary payload (just under the 64 KiB frame cap) round-trips intact.
- interleaved control/data frames keep their types and order.
- an app-specific WebSocket close code (4401) propagates: the peer sees `done`
  and isOpen flips.

6 new tests; full suite 808 pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
omnydrive 1.12.0 is now published (its HTTP servers are hosted on omnyhub),
so bump the constraint from ^1.11.0. All three packages now share the same
omnyhub transport/HTTP stack. Full suite green (808 pass) against 1.12.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gmpassos gmpassos merged commit 6f42e83 into master Jul 12, 2026
6 checks passed
@gmpassos gmpassos deleted the feature/omnyhub-migration branch July 12, 2026 02:28
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