Hello, we discovered the problem: attachment listeners triggered before the new attachment version uploaded and stored in Confluence (we discovered this problem in Confluence, but it probably also exists in Jira). I.e. we try to call attachmentManager.getAttachment(id); in the com.atlassian.confluence.event.events.content.attachment.AttachmentUpdateEvent listener and sometimes it returns attachment, but sometimes returns null for some reason which is probably because the listener has been triggered earlier than attachment has been added to DB. How to deal with this problem? Maybe there is some cache that needs to be refreshed or indexing that needs to complete?
Moved this question to developer community https://community.developer.atlassian.com/t/attachment-listeners-triggered-before-the-new-attachment-version-uploaded-and-stored-in-confluence/48238?u=alexeyaleinikov.
Phew, Atlassian Team 2021 blew by. With dozens of demos and a handful of keynotes, you may have missed some of the awesome Confluence Cloud sessions. Don't' worry, you can watch them all here or on Y...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events