rpc_dart_websocket 0.2.3
rpc_dart_websocket: ^0.2.3 copied to clipboard
Web-safe subset of rpc_dart_transports providing WebSocket caller/responder transports (caller + server) for Dart2JS/WASM builds.
0.2.3 #
- Fixed:
RpcWebSocketCallerTransportno longer permanently closes itself when the underlying socket drops gracefully (server-side FIN) and areconnectFactoryis configured. Previously theonDonecascade flipped the transport to closed, so a laterreconnect()returned "Transport closed" — defeating reconnect after a server-initiated drop. The stableincomingMessagesstream now survives the drop so subscribers persist andreconnect()can re-attach. This is the recovery path therpc_dart_logclient relies on. Without areconnectFactorythe transport still closes fully on drop (unchanged). - Expanded test coverage of the flagship streaming transport:
test/websocket_rpc_contract_test.dart: full typed RPC contract end-to-end over a realdart:ioWebSocket server (RpcWebSocketServer+RpcResponderEndpoint/RpcCallerEndpoint, ephemeral localhost port). Covers unary, server-stream (ordered delivery + completion), client-stream (aggregation), bidirectional (ordered echo), typedRpcStatusExceptionpropagation, mid-stream cancellation (no hang, transport stays usable), concurrent calls/streams (no cross-wiring), and a high-volume ordered stream.test/websocket_reconnect_test.dart: reconnect coverage (previously zero). Provesreconnect()re-establishes the socket, the stableincomingMessagesstream survives for pre-existing subscribers, requests issued after reconnect reach a freshly-bound server, full endpoint-level RPC recovers after a server swap, the no-factory/already-closed paths report correctly, and a regression guard for the graceful-drop fix above.
0.2.2 #
- Web-correctness verification: the client transport (
RpcWebSocketCallerTransport/RpcWebSocketChannel) is confirmed dart2js-safe. Nodart:ioon the client path; the frame multiplexer header uses only 32-bitByteDataops (nosetUint64/getUint64), so it is safe under dart2js' 32-bit integer semantics. - Added
test/websocket_web_smoke_test.dart: frame round-trip plus caller/responder round-trips over an in-memoryWebSocketChannelpair (nodart:io). Passes on VM, node, and chrome (fvm dart test -p vm|node|chrome). - Added
asyncandstream_channeldev dependencies for the in-memory channel pair used by the web smoke test.
0.2.1 #
RpcWebSocketServer: addedonPeerEndpointCreatedcallback — when set, each accepted connection creates anRpcPeerEndpointinstead ofRpcResponderEndpoint, enabling bidirectional server-initiated calls over WebSocket.RpcWebSocketCallerTransport.connect(): now awaitsWebSocketChannel.readybefore returning, so connection errors are reported at connect time rather than leaking as unhandled stream errors.- Updated to
rpc_dart: ^3.1.0.
0.2.0 #
- Updated to
rpc_dart: ^3.0.0. - Migrated to 3-layer transport architecture (
IRpcChannel/IRpcMultiplexedChannel/RpcChannelTransport). - WebSocket metadata encoding switched to binary CBOR for consistency with core.
0.1.0 #
- Initial release: WebSocket caller/responder transports for rpc_dart (web-safe, works on Dart2JS/WASM).