Multi-events handling

Hi. I’m trying in JavaScript to update a Jira entity property as a response to issue-link-created-event. I’m able to do it fine for one link. But, if you link two tickets to another ticket at a singe action - two events are received asynchronously and the property is being overrun instead of appended to. I tried protecting it (waiting on global object with mutex), but seems like sometimes it’s happening almost at the exact same time and it’s too fast. So sometimes it works and sometimes it doesn’t.
Did anyone encounter something similar? Any bright ideas?
Thanks much.