rpc_dart_log 0.3.1
rpc_dart_log: ^0.3.1 copied to clipboard
Real-time remote log collector for rpc_dart. Collect logs from mobile/server apps over WebSocket.
0.3.1 #
Changed #
- Accepts
rpc_dart_websocket0.5.x as well as 0.4.x. Nothing here uses the APIs 0.5.0 adds, so the constraint is widened rather than moved.
0.3.0 #
Fixed #
- The MCP buffer's per-scope statistics are bounded; scope names are effectively unbounded in cardinality, so the map grew without limit.
Changed #
- Requires rpc_dart 6 and rpc_dart_websocket 0.4. See their changelogs — in
particular that the WebSocket client no longer offers
permessage-deflate, which this collector's transport used by default.
0.2.2 #
- Stop silently swallowing two error sites:
LogCollectorServer(log_server.dart): a failed WebSocket upgrade was dropped viaonError: (_) {}, making failed client connections invisible. Now logged tostderrat a non-fatal severity; server control flow is unchanged.LogCollectorOutput(log_output.dart): a handshake failure dropped the connection and retried but never logged why, making connection problems undebuggable. Now logs the caught error viadart:developer.log, a low-level diagnostic that does NOT re-enter theLogController/LogOutputpipeline this class feeds (avoiding a logging-recursion loop). Existing retry/reconnect behavior is unchanged.
0.2.1 #
Client (LogCollectorOutput):
- Reconnect handling now delegates to
RpcClientConnection(frompackage:rpc_dart), the canonical transport-agnostic auto-reconnect wrapper, instead of a hand-rolled backoff loop on top ofRpcWebSocketCallerTransport.reconnect.RpcClientConnectionowns the backoff and attempt limits, rebuilds the WebSocket transport via the existingchannelFactoryon every attempt, and exposes a stable proxy transport. TheRpcCallerEndpointand caller are built once on that proxy and survive reconnects. This removes the duplicated reconnect/backoff code (_scheduleReconnect, the manual attempt counter, direct transportreconnect()calls). - Lifecycle is driven off
RpcClientConnection.state: on the transition toRpcClientOnlinethe client re-handshakes (device info) and flushes the buffer; while not online it buffers. Same observable guarantees as before -- bounded buffer (drop oldest), pipelined fire-and-forget sends that never blockwrite, ordered flush, and no loss across reconnect (unacked in-flight records are requeued at the buffer head and re-sent after the next Online). - Public API unchanged:
channelFactory,sessionId,isConnected,bufferedCount,inFlightCount.
0.2.0 #
Protocol redesign of the client transport path (breaking).
Client (LogCollectorOutput):
- Web-safe: the client library (
package:rpc_dart_log/rpc_dart_log.dart->LogCollectorOutput+DeviceInfo+ contracts) no longer pulls anydart:ioserver code, so it compiles and runs on dart2js / node / browser. Server-side code stays behindrpc_dart_log_server.dart. Mobile and Flutter-Web apps embed exactly this client. - Reconnect now uses the WebSocket transport's built-in
RpcWebSocketCallerTransport.reconnect: the transport, endpoint and caller are built once and reused across reconnects via a channel reconnect factory, instead of rebuilding the whole endpoint per attempt. - Record sends are pipelined fire-and-forget on the logging hot path:
writenever blocks and the pump issues the next send without awaiting the previous ack, so per-record round-trip latency no longer caps throughput. The empty-Ack reply is consumed off the hot path only to advance the bounded in-flight window; unacked in-flight records are requeued at the buffer head on reconnect (order preserved, no loss). - New public surface for diagnostics/tests:
channelFactoryconstructor param,sessionId,isConnected,bufferedCount,inFlightCount.
0.1.1 #
Fixes (audit):
- Client output (
LogCollectorOutput): the re-buffer path on send failure now enforcesbufferSize(was unbounded), and the flush is serialized -- a record is removed from the buffer only after its send succeeds, preserving order and preventing loss/reordering on reconnect. - Server handshake is now idempotent per connection: a duplicate handshake no longer leaks the previous session or emits a spurious
DeviceConnected. - MCP server: a malformed/non-object JSON body now returns a JSON-RPC
-32700parse-error envelope (HTTP 200) instead of an HTTP 500 with a stack trace. mcp_buffer: a stale cursor (older than the eviction horizon) is now signalled with a reset warning instead of silently returning the whole buffer; eviction uses aListQueuefor O(1) removal.
Security:
- The collector and MCP servers now bind
127.0.0.1by default (was0.0.0.0); use--bind-allto opt into binding all interfaces. - The MCP OAuth
authorizeendpoint now allowlists loopbackredirect_uritargets only (rejecting open-redirect attempts) and issues a random per-request token instead of a static one. The flow remains dev-only/unauthenticated.
0.1.0 #
- Initial release: real-time remote log collector over WebSocket (
LogCollectorOutputclient,LogCollectorServer+LogCollectorConsole), andLogCollectorMcpServerfor Claude Code integration.