Repository navigation
Conversation
…on in each TcpStream
…rd write confirmation
| index. `UnknownId`, `NoClient`, `Encode` and `Gone` are returned to the caller, | ||
| not published as transport reports. Encoding validates representation, not | ||
| application safety rules. | ||
| - Success means **queued**, not written, received or executed. A full queue waits |
There was a problem hiding this comment.
Conceptual error: success should mean order send (or even better ack recived idnk if that's posible)
Furthermore, queue should not exists. When calling the function to send should return ok if the OrderPacket was sent or Error (to Event) if it couldn't be sent (because it failed, because the connection broke or has never been established).
This can be dangerous, suppose a board is not connected and you start sending orders to it, all the orders are stored in the queue, as soon as the board connects to the backend it will recieve all the orders together, which might cause a critical situation
NO QUEUE
| .board(definition.board) | ||
| .ok_or(SendError::NoClient(definition.board))?; | ||
|
|
||
| handle.send(order).await |
There was a problem hiding this comment.
In the case that you try to send an order to a board that isn't connected, this board isn't maped in Handles (edit: now BoardClients), so the method board returns an error which is transformed with .ok_or() to a SendError::NoClient.
Makes sense?
| /// Returns the configured boards whose write completion was not confirmed | ||
| /// (offline, session ended, I/O failure, or deadline elapsed). A failed/partial write is never | ||
| /// retried and ends that session. Failure does not prove no bytes were delivered. | ||
| pub async fn propagate_fault(&self) -> Result<(), Unreachable> { |
There was a problem hiding this comment.
This function does not propagate fault, just sends it, please consider rename it
There was a problem hiding this comment.
I fo not understand this function, claude states that can be simplified usign future::join_all.
| ### Reporting, framing and cancellation | ||
|
|
||
| TCP accumulates partial input and extracts complete ADJ-dependent frames. An | ||
| undecodable suffix waits for more bytes until it exceeds the 374-byte framing |
There was a problem hiding this comment.
This checks if the packet that arrives is one defined by us. If firmware or us fail to encode correctly a packet making it larger than 374 bytes, which has to be processed by this, pops an error.
There was a problem hiding this comment.
If the function declared in the module protocol which decodes, if fails to decode a packet with a length of 374 bytes, this means that is not well encoded or is not defined.
| /// | ||
| /// Starting a nonempty configuration outside a Tokio runtime panics, as does | ||
| /// [`tokio::spawn`]. | ||
| pub fn spawn(config: Config, adj: Arc<Index>, reporter: Reporter) -> Handles { |
There was a problem hiding this comment.
Do not call index as adj
GaziH
left a comment
There was a problem hiding this comment.
looks great overall, waiting on Javier's requested changes to be implemented.
Summary
Validation
Automated tests and local loopback checks pass, but end-to-end validation against board firmware is still pending.
Please review
propagate_fault()carefully, particularly whether its behavior matches the firmware's expectations. Its current success result confirms only the TCP write, not firmware receipt or execution.Pending