The MQTT 3.1.1 spec, section 3.1.2.4 says
If CleanSession is set to 1, the Client and Server MUST discard any previous Session and start a new one. This Session lasts as long as the Network Connection. State data associated with this Session MUST NOT be reused in any subsequent Session [MQTT-3.1.2-6].
The Session state in the Client consists of:
· QoS 1 and QoS 2 messages which have been sent to the Server, but have not been completely acknowledged.
· QoS 2 messages which have been received from the Server, but have not been completely acknowledged.
Meaning the client must discard unacked QoS 1 messages and not reuse any data from them in the new session.
However, there seem to be plenty of examples in the wild of clients resending unacked QoS 1 messages on a clean session reconnect.
Resending unacked messages is almost indistinguishable in this case from sending a new message with the same content, except for the DUP flag - is it wrong for a client to set the DUP flag when retrying unacked messages on a clean session?
Also, surely it's a violation to retry QoS 2 messages on a clean session reconnect, since that could potentially break the at most once delivery guarantee?