aio-pika icon indicating copy to clipboard operation
aio-pika copied to clipboard

Incorrect processing of message

Open decaz opened this issue 5 years ago • 1 comments

I think there is inconsistency of IncomingMessage.__processed flag with the state at the server side. Here is the processing within IncomingMessage.ack method: https://github.com/mosquito/aio-pika/blob/d65c2f4551b4fd75e4e15443042d716b3ac68c3c/aio_pika/message.py#L544-L552

If there was an error in basic_ack task then message will be marked as processed whatever. I guess there should be awaiting of task before marking message as processed. So ack, reject and nack methods of IncomingMessage should become async.

decaz avatar Dec 10 '19 16:12 decaz

Another but not the best way (to save backward compatibility) is to mark message as processed at done callback of the task.

decaz avatar Dec 10 '19 17:12 decaz