Azure / Azure/azure-sdk-for-rust

azure_core_amqp: the receiver attach path ignores receiver_settle_mode and target

Open
#4,809 1 comment 1 reaction 0 assignees View on GitHub
Azure.Core
Dominant language
Rust
Stars
884
Forks
365
Avg merge
2d 19h
Merged PRs (30d)
112

Description

## Summary

Two public fields on `AmqpReceiverOptions` have no effect. The receiver attach path never reads `receiver_settle_mode` or `target`. It hardcodes `ReceiverSettleMode::First`, and it drops `target`.

## Motivation

`sdk/core/azure_core_amqp/src/receiver.rs` declares both fields with doc comments, "The receiver settle mode for the AMQP receiver" and "The target for the AMQP receiver". The attach path in `sdk/core/azure_core_amqp/src/fe2o3/receiver.rs` reads only `name`, `credit_mode`, `auto_accept` and `properties`. A caller who sets either field gets no error and no effect.

This is the same class of defect as #4804, where the builder silently discarded link properties. That one made `OpenReceiverOptions::owner_level` a no-op in Event Hubs. Nobody noticed until a live run read the Attach frame.

A public option that has no effect cannot be caught by the type system, and it produces no diagnostic. It survives until a test reads the Attach frame.

No caller in this repository sets either field today, so there is no known impact on users. It is a correctness problem, not an outage.

## Proposal

Apply both fields in the receiver attach path. If neither field has a use case, remove them, so the API does not advertise controls that do not exist.

The fe2o3 link builder discards link properties when a builder method changes the builder type. `target` is one such method, as #4804 and #4805 describe. A call to `.target(...)` after `.properties(...)` therefore brings back that defect. The builder helpers in #4805 call the type-changing methods first for this reason, and the tests there catch a later call that breaks the order.

Add a test that asserts the link builder carries the requested settle mode and target. Use the same shape as the property tests in #4805.

Contributor guide

Open the contributing guide

Research direction

Start with sdk/core/azure_core_amqp/src/receiver.rs to inspect AmqpReceiverOptions, then follow the attach path in sdk/core/azure_core_amqp/src/fe2o3/receiver.rs. Read the property tests referenced in #4805 and run the relevant crate tests. Done means the requested receiver settle mode and target are preserved in the link builder and verified from the Attach frame.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.