At multiple places in the documentation comments it is stated that the will is sent as soon as we are connected. According to the RFC, the will is sent when we are disconnecting without sending a DISCONNECT packet with reason code 0: https://datatracker.ietf.org/doc/html/rfc9431#section-1.3-4.24.1
The behaviour is correct (as we are just sending the information in the CONNECT packet and the broker is handling it), it's just the documentation that is incorrect.
At multiple places in the documentation comments it is stated that the will is sent as soon as we are connected. According to the RFC, the will is sent when we are disconnecting without sending a DISCONNECT packet with reason code 0: https://datatracker.ietf.org/doc/html/rfc9431#section-1.3-4.24.1
The behaviour is correct (as we are just sending the information in the CONNECT packet and the broker is handling it), it's just the documentation that is incorrect.