replay: only append the message if it isn't present in the replay
Add some documentation for the queries