Operations such as back-filling data can deliver messages out of order. The code currently updates the last_seen time to the message timestamp without checking if the message timestamp is earlier than the current last_seen time.
This makes it look like devices are late while the back-fill operation is running.