Open kalisp opened 2 months ago
Task linked: AY-5570 shotgrid: reviving archived assets is broken
I am really against re-submitting leeched events in processor, it should not touch leeched events at all. At the first time of processing the event there might be other events changing or removing the same entity, so moving the event to the end of queue is a huge risk. There might be a real reason why parent was not synced, and re-submitting of the event can cause infinite loop of the event. It should be handled at the moment when we find out the parents are missing.
There also might be other services listening to leeched events, and re-submitting the events can cause their failure.
I'm not responsible for this addon, but for me this is no way.
@MilaKudr could you re-test this please?
It is not working for me at the moment, after deleting the task in Ayon I get error messages like: "2024-09-10 17:18:18.531 | update_from_ayon | remove_sg_entity_from_ayon_event | WARNING: Entity 'a82667b96f8711ef8ccdccd9acc131df' does not have a path to remove from Shotgrid.
It is not working for me at the moment, after deleting the task in Ayon I get error messages like: "2024-09-10 17:18:18.531 | update_from_ayon | remove_sg_entity_from_ayon_event | WARNING: Entity 'a82667b96f8711ef8ccdccd9acc131df' does not have a path to remove from Shotgrid.
That was sorted out.
Currently its waiting for budget as there is a pushback for current implementation.
It shouldn't modify/create new messages, but re-create full folder structure if necessary. That is not trivial because of current code structure.
I tried to rework logic without creating new event just by creating missing parents in the loop. Not most elegant code there though :/.
Changelog Description
This PR supports recreation of children Tasks in AYON if deleted Asset is revived in Shotgrid.
Additional info
I don't like this solution too much, open for comments.
Main issue is that revival of assets on SG sends these events (in order) -
attribute_change
for CHILD task,attribute_change
for Asset,revival_entity
. If we are processing firstattribute_change
, it wants to update non existing Task under non existing Asset. Right now this throws newMissingParentError
exception, that could be handled specifically.It fails processing event, it creates new source event on
shotgrid.event
(there is no way how to create new event on processing topic, imho), which gets put on the end of the queue. Then asset gets recreated, then this new event gets reprocessed (only once), this time hopefully it finds parent asset in AYON, so it finishes successfully (or fails forever).Testing notes:
service_tools/manage.ps
services`)