mosquito / aiormq

Pure python AMQP 0.9.1 asynchronous client library
Other
259 stars 56 forks source link

DeliveredMessage might not have delivery_tag #100

Open astrojuanlu opened 3 years ago

astrojuanlu commented 3 years ago

Getting this typing error on my callback that got passed to basic_consume:

error: Item "GetEmpty" of "Union[Deliver, GetEmpty, GetOk]" has no attribute "delivery_tag"  [union-attr]
                await message.channel.basic_ack(message.delivery.delivery_tag)
                                                ^

where message is of type aiormq.types.DeliveredMessage, defined here:

https://github.com/mosquito/aiormq/blob/dde0ce860339c775c01c6eb829e75452259b6e1d/aiormq/types.py#L12-L20

astrojuanlu commented 3 years ago

The problem did not appear with aiormq-3.3.1 pamqp-2.3.0, but it appears with latest aiormq and pamqp.