feat: message ack with atomic cleanup (story 1.8)#10
Merged
vieiralucas merged 5 commits intomainfrom Feb 12, 2026
Merged
Conversation
69e45f6 to
c00fee8
Compare
There was a problem hiding this comment.
2 issues found across 7 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="crates/fila-core/src/storage/keys.rs">
<violation number="1" location="crates/fila-core/src/storage/keys.rs:103">
P2: `parse_expiry_from_lease_value` accepts any buffer ≥ 8 bytes and ignores the length prefix/separator. This can treat corrupted lease values as valid and derive a wrong expiry, leaving the real `lease_expiry` entry orphaned. Consider validating the encoded length and separator before parsing the expiry.</violation>
</file>
<file name="crates/fila-core/src/broker/scheduler.rs">
<violation number="1" location="crates/fila-core/src/broker/scheduler.rs:253">
P2: `find_message_key` drops `list_messages` errors, so `handle_ack` will still delete the lease/expiry and return success even when message scanning failed, leaving the message in the queue to be redelivered. Propagate the storage error instead of treating it as “message not found.”</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Base automatically changed from
feat/1-7-consumer-lease-message-delivery
to
main
February 12, 2026 01:42
…d expiry (story 1.8) add handle_ack to scheduler that validates lease existence, parses expiry timestamp from lease value, finds the full message key by scanning messages CF, and atomically deletes the message, lease, and lease_expiry entries via WriteBatch. implement Ack grpc rpc with uuid parsing and input validation. acking an unknown or already-acked message returns MessageNotFound.
c00fee8 to
e7a8f09
Compare
parse_expiry_from_lease_value now validates the length prefix and separator instead of blindly grabbing the last 8 bytes, preventing wrong expiry derivation from corrupted values. find_message_key now propagates storage errors instead of swallowing them with .ok(), preventing ack from succeeding while leaving the message in the queue for redelivery.
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
handle_ackin scheduler: validates lease exists, parses expiry from lease value, finds message key by scanning messages CF, atomically deletes message + lease + lease_expiry viaWriteBatchAckgRPC RPC with UUID parsing and input validationparse_expiry_from_lease_value()to keys moduleNOT_FOUND(idempotent)Test plan
MessageNotFoundMessageNotFoundon second call (idempotent)Summary by cubic
Adds message acknowledgment (Story 1.8). Ack atomically removes the message, lease, and lease expiry, is idempotent, and rejects corrupt lease values.
New Features
Bug Fixes
Written for commit 2bd310c. Summary will update on new commits.