huridocs / uwazi

Uwazi is a web-based, open-source solution for building and sharing document collections
http://www.uwazi.io
MIT License
242 stars 80 forks source link

AT entity creation event listener fix #7386

Closed daneryl closed 1 month ago

daneryl commented 1 month ago

not using permissions commandContext anymore, the listener gets executed in the same context as the entity creation, we are only separating this into a event listener / use case to decouple v1 and v2 codes.

for some reason some of the entity saves at this point ocury without the entities having _id even though they where already created and in this case the special permission commandId gets replaced on the entities leaving them "corrupted" with a wrong id.

this pr fixes the issue because we do not need to use the commandContext, but the original issue causing this potentially remains and should be understood.