Hi all! I've ran into an unexpected behavior and can't figure out what's the source of it. I'm using apoc 3.5.0.9, and I'm trying to have a trigger in "phase: after" that creates a relationship with the node that has been updated with some other node, but this causes the trigger to never end.
For instance, with this dataset:
CREATE (:TEST {name:'x', _executed:0});
CREATE (:TEST {name:'y', _executed:0});
And this simple trigger:
CALL apoc.trigger.add('triggerTest','UNWIND apoc.trigger.propertiesByKey({assignedNodeProperties},"_executed") as prop
WITH prop.node as n
CREATE (z:SON {father:id(n)})
CREATE (n)-[:GENERATED]->(z)
',
{phase:'after'});
Which is supposed to catch the update event and, after the transaction that updates the _executed property commits, creates a new relationship with the updated node and the new node z.
However, unless I terminate the query this never seems to end, and if I do terminate it, it will leave the graph in the same state it was before the update, except that the _executed property was indeed updated... But neither the new node or the new relation was created.
If this said trigger is in "phase: before" or if there are no new relations created in the trigger concerning the node updated (i.e. if there is no relation created using the node n), this has the expected behavior and all goes smoothly...
Can anyone help me understand what's causing this in "phase: after"?