Attachment listeners triggered before the new attachment version uploaded and stored in Confluence

I actually reproduced this in Confluence Data Center, because Confluence server versions are not supported now, so I created a question in the “Confluence” category, see Attachment listeners triggered before a new attachment version uploaded and stored in Confluence, because this question is not Confluence Server specific and maybe not also Confluence DC specific.