Map client decode/transport failures to WireframeError (complete)#459
Map client decode/transport failures to WireframeError (complete)#459
Conversation
…o WireframeError Introduce error mapping in the client request/response pipeline such that client decode failures are represented as WireframeError::Protocol and transport failures as WireframeError::Io. This aligns client error semantics with the server-side model and improves consistency. - Update client runtime and messaging modules to emit WireframeError variants - Add unit tests with rstest covering error mapping cases - Add integration tests to round-trip multiple message types through the client - Bump rstest-bdd dependencies to version 0.5.0 and extend behavioral tests - Document design decisions and update user's guide with migration notes - Mark roadmap item 10.2.2 as done in project docs This change preserves existing framing and lifecycle hooks, with no breaking API changes beyond error representation and includes comprehensive test coverage and documentation updates. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Reviewer's GuideImplements client-side mapping of request/response decode and transport failures into WireframeError variants, updates the ClientError surface and exports, and adds tests, docs, and execplan/roadmap updates to validate and document the new behavior. Sequence diagram for client receive pipeline error mapping to WireframeErrorsequenceDiagram
actor ClientApp
participant WireframeClient
participant ClientRuntime
participant Messaging as ClientMessaging
participant Framed as FramedTransport
participant Serializer
ClientApp->>WireframeClient: call(request)
WireframeClient->>ClientRuntime: call(request)
ClientRuntime->>ClientMessaging: receive_internal()
alt transport_closed_before_frame
ClientMessaging->>Framed: next()
Framed-->>ClientMessaging: None
ClientMessaging->>ClientError: disconnected()
Note right of ClientError: wraps io::ErrorKind::UnexpectedEof
ClientMessaging-->>ClientRuntime: Err(ClientError::Wireframe(WireframeError::Io(_)))
ClientRuntime-->>WireframeClient: Err(ClientError::Wireframe(WireframeError::Io(_)))
WireframeClient-->>ClientApp: Err(ClientError::Wireframe(WireframeError::Io(_)))
else frame_received_but_decode_fails
ClientMessaging->>Framed: next()
Framed-->>ClientMessaging: Some(frame)
ClientMessaging->>Serializer: deserialize(frame.bytes)
Serializer-->>ClientMessaging: Err(source_error)
ClientMessaging->>ClientError: decode(Box_dyn_Error_Send_Sync)
Note right of ClientError: builds WireframeError::Protocol(ClientProtocolError::Deserialize(_))
ClientMessaging-->>ClientRuntime: Err(ClientError::Wireframe(WireframeError::Protocol(ClientProtocolError::Deserialize(_))))
ClientRuntime-->>WireframeClient: Err(ClientError::Wireframe(WireframeError::Protocol(ClientProtocolError::Deserialize(_))))
WireframeClient-->>ClientApp: Err(ClientError::Wireframe(WireframeError::Protocol(ClientProtocolError::Deserialize(_))))
end
Class diagram for updated client error types and WireframeError mappingclassDiagram
class ClientProtocolError {
<<enum>>
+Deserialize(source: Box_dyn_Error_Send_Sync)
}
class WireframeError_E {
<<generic_enum>>
+Io(error: io_Error)
+Protocol(error: E)
+Codec(error: Box_dyn_Error_Send_Sync)
}
class ClientWireframeError {
<<typealias>>
}
class ClientError {
<<enum>>
+Wireframe(error: ClientWireframeError)
+Serialize(source: Box_dyn_Error_Send_Sync)
+PreambleEncode(source: bincode_error_EncodeError)
+PreambleDecode(source: bincode_error_DecodeError)
+PreambleVersionMismatch(expected: u32, received: Option_u32)
+CorrelationMismatch(expected: u64, received: Option_u64)
+decode(source: Box_dyn_Error_Send_Sync) ClientError
+disconnected() ClientError
}
class io_Error {
}
ClientWireframeError --> WireframeError_E : alias_of
WireframeError_E --> ClientProtocolError : Protocol_E
ClientError --> ClientWireframeError : uses
ClientError ..> io_Error : From_io_Error
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Summary by CodeRabbit
WalkthroughMap client transport I/O and decode failures into WireframeError variants, refactor ClientError into a unified Wireframe wrapper with ClientProtocolError::Deserialize, update client call sites and constructors and tests/BDD steps, add ExecPlan and user/docs, and bump rstest-bdd dev-dependencies to 0.5.0. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Transport as Transport
participant Decoder as Decoder
participant Wireframe as Wireframe
Client->>Transport: send/receive frame
alt Transport I/O failure
Transport-->>Client: io::Error
Client->>Wireframe: wrap as WireframeError::Io
Wireframe-->>Client: ClientError::Wireframe(WireframeError::Io)
else Frame received
Client->>Decoder: attempt deserialize
alt Decode failure
Decoder-->>Client: Deserialize error
Client->>Wireframe: wrap as WireframeError::Protocol(ClientProtocolError::Deserialize)
Wireframe-->>Client: ClientError::Wireframe(WireframeError::Protocol(...))
else Successful decode
Decoder-->>Client: Parsed message
Client->>Client: normal processing
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
…iants - Introduce ClientProtocolError and ClientWireframeError for client request/response error mapping. - Transport failures map to WireframeError::Io within ClientError::Wireframe. - Decode failures map to WireframeError::Protocol with ClientProtocolError::Deserialize. - Refactor client error handling in messaging and runtime modules to use new error mapping. - Add integration tests covering multiple message round-trips and error mappings. - Update behavioural tests to check mapping of decode and transport errors. - Upgrade rstest-bdd dependency to 0.5.0. - Update client design and user guide documentation with error mapping details. - Mark roadmap item 10.2.2 as complete. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Corrected multiple occurrences of British English spellings to American English spellings (e.g., serialisation -> serialization, centralised -> centralized, deserialisation -> deserialization) and improved consistency within the execplans/10-2-2-client-decode-and-transport-failures.md documentation and wireframe-client-design.md. These are documentation spelling corrections and minor grammar fixes to enhance clarity and standardize terminology. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…for WireframeError variants Correct spacing around `ClientError::Wireframe(WireframeError::Protocol(...))` variant in documentation files to improve clarity and consistency. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@docs/execplans/10-2-2-client-decode-and-transport-failures.md`:
- Line 53: Update the sentence "a row without net progress, pause and document
the blocker." to include the Oxford comma by changing it to "a row without net
progress, pause, and document the blocker." Locate this exact phrase in
docs/execplans/10-2-2-client-decode-and-transport-failures.md and insert the
comma before "and" so the list uses the Oxford comma consistently across the
document.
- Line 124: The decision log entry "intent. Date/Author: 2026-02-12 / Codex" is
missing terminal punctuation; edit that exact string in the file and append a
period so it reads "intent. Date/Author: 2026-02-12 / Codex." to ensure the
entry ends with a full stop.
- Line 130: The decision log entry line containing the exact text "churn.
Date/Author: 2026-02-12 / Codex" is missing terminal punctuation; edit that line
(the string "churn. Date/Author: 2026-02-12 / Codex") to append a period so it
reads "churn. Date/Author: 2026-02-12 / Codex." ensuring the decision log entry
ends with a full stop.
- Line 135: The decision log entry "2026-02-12 / Codex" is missing terminal
punctuation; update that string (search for the exact text "2026-02-12 / Codex"
in the docs/execplans file and replace it with "2026-02-12 / Codex.") so it ends
with a full stop.
Corrected punctuation in author/date lines by adding periods. Reworded iteration failure condition for clarity: - changed 'fmt, lint, test' to 'fmt, lint, or test' for readability. Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
…res docs Co-authored-by: devboxerhub[bot] <devboxerhub[bot]@users.noreply.github.com>
Summary
Changes
Rationale
Plan of work (status: implemented)
Validation plan / gates
Artifacts and touched files (highlights)
Revision note
📎 Task: https://www.devboxer.com/task/8d8a6b50-96ec-4684-b422-39880061150c