How often is Ratchet key pair changed in signal protocol?

At first I thought the new ratchet key is created with each first incoming message. After that I believed it depends on the implementation. But after closer look at the signal documentation and following picture, I am left even more confused.

The picture above shows Alice sending message A2 and after that receiving message B2 from Bob, which uses his old key. How is this possible? Shouldn't Bob update his key on receiving Alice's A2 message. Message A2 features a new ratchet key, and should trigger DH ratchet on Bob side and update his Receiving and Sending chain, thus his next message (B2) would use a newly created key?

What I am missing here?

Alice will trigger a DH ratchet step when she receives a new public key in the header of the message sent by bob (section 4.1 of double ratchet specification[0] goes into the detail of it). In this case, B2's header did not have a new public key, while B3 and B4 do.
Coming to your question, It doesn't matter if A2 had a new key or not. Why? Because this protocol allows for messages to arrive with old keys. Think of the case where Alice's message is not delivered but bob keeps sending message(s).
New ratchet key pair is generated with every incoming message to derive new key for sending chain and last Ratchet key pair is kept to derive key for receiving chain. As shown in the image, Bob's public ratchet key B1 is making DHE to derive key for receiving messages B1 and B2 and public ratchet key B1 is also making DHE with new ratchet key pair of Alice to derive key for sending messages.
The sending chain actually go beyond A4 as long as Alice is not receiving any message from Bob. Once Bob replies, Alice will create new rathchet key pair for sending chain. The image shows that when Bob replies with messages B1 and B2, Alice terminates the chain with message A1 and generates a new ratchet key pair to send A2, A3 and A4.