Azure / Azure/azure-sdk-for-rust
[Service Bus] Settlement sends the wrong AMQP outcomes and discards caller input
- Dominant language
- Rust
- Stars
- 884
- Forks
- 365
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 109
Description
## Summary
Three of the four settlement dispositions are wrong. Abandon and dead letter accept options that never reach the service, and defer calls a management operation that is not documented.
## Motivation
Service Bus has four dispositions that map onto three AMQP outcomes. Complete is `Accepted`. Abandon is `Modified` with `undeliverable-here` false. Defer is `Modified` with `undeliverable-here` true. Dead letter is `Rejected` carrying a reason and a description.
The current behaviour differs on three of the four.
| Disposition | Correct outcome | Current call | Discarded |
| --- | --- | --- | --- |
| Abandon | `Modified{undeliverable-here=false}` | `release_delivery` at `src/receiver.rs:1066` | `properties_to_modify` |
| Defer | `Modified{undeliverable-here=true}` | `com.microsoft:defer-message` at `src/receiver.rs:1307` | operation name is not documented |
| Dead letter | `Rejected` with a condition | `reject_delivery` at `src/receiver.rs:1184` | `reason`, `error_description`, `properties_to_modify` |
`com.microsoft:defer-message` appears in neither the published operation list nor `ManagementConstants.cs` in `azure-sdk-for-net`. The Go SDK defers with a `Modified` outcome that sets `UndeliverableHere`, and it falls back to `com.microsoft:update-disposition`.
Each of the three returns `Ok(())`, so a caller that sets a dead letter reason sees success and gets a message with no reason on the dead letter queue.
## Proposal
- Send `Modified` with `undeliverable-here` false for abandon, and carry `properties_to_modify` in the message annotations.
- Send `Modified` with `undeliverable-here` true for defer, and delete the `com.microsoft:defer-message` call.
- Send `Rejected` with the dead letter reason and description for dead letter.
- Add a live test for each disposition that reads the settled message back and asserts the annotations survived.
## Dependencies
Blocked by:
- #4935 [AMQP] Receiver cannot send Modified or annotated Rejected dispositions
Sub-issue of #4934.
Contributor guide
Research direction
Start with src/receiver.rs at lines 1066, 1184, and 1307, then review the AMQP receiver support tracked in #4935. Add live tests for abandon, defer, and dead letter that read each settled message back and assert annotations survive; done means the three outcomes and caller inputs match the proposal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100