feat: story 7.1 — rust client sdk#30
Merged
vieiralucas merged 9 commits intomainfrom Feb 19, 2026
Merged
Conversation
new fila-client crate providing idiomatic rust sdk for fila broker. wraps tonic-generated FilaServiceClient with ergonomic api: connect, enqueue, lease (streaming), ack, nack. context-aware error mapping distinguishes queue vs message not-found. LeaseMessage struct flattens proto types for ergonomic consumption. 3 integration tests verify full lifecycle against real fila-server.
There was a problem hiding this comment.
2 issues found across 10 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/fila-client/tests/integration.rs">
<violation number="1" location="crates/fila-client/tests/integration.rs:94">
P2: The startup poll never asserts that the server actually became reachable. If the timeout elapses, the test proceeds with an unusable client, leading to confusing downstream failures. Track whether a connection succeeded and assert after the loop.</violation>
</file>
<file name="crates/fila-client/src/client.rs">
<violation number="1" location="crates/fila-client/src/client.rs:118">
P2: Missing `message` fields in a lease response are silently dropped due to `?` inside `filter_map`. This hides protocol errors and can leave consumers unaware of a malformed response. Return an explicit error when `message` is `None` instead of filtering it out.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| let stream = response.into_inner().filter_map(|result| match result { | ||
| Ok(lease_response) => { | ||
| let msg = lease_response.message?; |
There was a problem hiding this comment.
P2: Missing message fields in a lease response are silently dropped due to ? inside filter_map. This hides protocol errors and can leave consumers unaware of a malformed response. Return an explicit error when message is None instead of filtering it out.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/fila-client/src/client.rs, line 118:
<comment>Missing `message` fields in a lease response are silently dropped due to `?` inside `filter_map`. This hides protocol errors and can leave consumers unaware of a malformed response. Return an explicit error when `message` is `None` instead of filtering it out.</comment>
<file context>
@@ -0,0 +1,173 @@
+
+ let stream = response.into_inner().filter_map(|result| match result {
+ Ok(lease_response) => {
+ let msg = lease_response.message?;
+ let metadata = msg.metadata.unwrap_or_default();
+ Some(Ok(LeaseMessage {
</file context>
Integration tests in fila-client spawn fila-server as a subprocess. cargo nextest run only compiles test binaries, not the main server binary. Add cargo build --workspace to ensure all binaries are available.
vieiralucas
commented
Feb 19, 2026
Member
Author
vieiralucas
left a comment
There was a problem hiding this comment.
It annoys me that every method can return all the errors by the types. But that's not true. And for instance lease, the returned Result can have a QueueNotFound, but the inner one can never produce a QueueNotFound.
Each SDK method now returns only the errors it can actually produce: - ConnectError for connect/connect_with_options - EnqueueError (QueueNotFound + StatusError) for enqueue - LeaseError (QueueNotFound + StatusError) for lease setup - StatusError for lease stream items (no QueueNotFound possible) - AckError (MessageNotFound + StatusError) for ack - NackError (MessageNotFound + StatusError) for nack Follows the same per-command pattern as fila-core/error.rs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fila-clientcrate: idiomatic Rust SDK wrapping tonic-generatedFilaServiceClient<Channel>enqueue,lease(streaming),ack,nackQueueNotFoundvsMessageNotFoundbased on operationLeaseMessageflattens protoMessage+MessageMetadatainto ergonomic structFilaClientisClone + Send + Sync— safe to share across tokio tasksAcceptance Criteria Covered
FilaClient::connect(addr)returns connected clientenqueue(queue, headers, payload) -> Result<String>lease(queue) -> Result<impl Stream<Item = Result<LeaseMessage>>>ack(queue, msg_id) -> Result<()>nack(queue, msg_id, error) -> Result<()>ConnectOptionswith addr + timeout (TLS placeholder for future)Test Summary
New Files
crates/fila-client/Cargo.tomlcrates/fila-client/src/lib.rscrates/fila-client/src/client.rscrates/fila-client/src/error.rscrates/fila-client/tests/integration.rsSummary by cubic
Adds a new fila-sdk crate: an idiomatic Rust SDK wrapping the tonic FilaServiceClient with connect, enqueue, streaming lease, ack, and nack. Addresses Story 7.1 with per-operation error types, an ergonomic LeaseMessage, end-to-end tests, and CI that builds the workspace so tests can spawn fila-server.
New Features
Refactors
Written for commit d052e4f. Summary will update on new commits.