I'm sorry, this did miss 4.0.7. It's going into 5.0 beta 1, but we'll get this backported for 4.0.8.
This particular issue is easy to trigger in a small testing environment, but is extremely unlikely in production, as the IDs between different types of file attachments diverge. Two comments of the same type (diff comments, file attachment comments, etc.) will never collide. It's only if the same review request has multiple comments of different types with the same database ID, which is why you're seeing it in the test environment when testing the different comment types.
Our focus right now is on the 5.0 betas, but we'll aim for a 4.0.8 in the next few weeks.