Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletion from a trigger fails to cascade to more triggers #112

Open
neo-technology-build-agent opened this issue Sep 1, 2022 · 1 comment

Comments

@neo-technology-build-agent
Copy link
Collaborator

Issue by kraney
Tuesday Jul 16, 2019 at 23:50 GMT
Originally opened as neo4j-contrib/neo4j-apoc-procedures#1258


Expected Behavior (Mandatory)

A trigger for deletedRelationship is called regardless of where or why the relationship was deleted.

Actual Behavior (Mandatory)

Trigger is not called when the relationship is deleted from inside another trigger.

How to Reproduce the Problem

Set up a two-hop path where each hop should be automatically deleted by a trigger. Only the first hop will be deleted because the second hop's trigger will never be called.

Simple Dataset (where it's possibile)

CREATE (a:Resource {name: 'foo'});
CREATE (s:Selector {name: 'sel'});
CREATE (k:KVP {key: 'foo', value: 'bar'});
CALL apoc.trigger.add('deleteOrphanedLabels',
  "UNWIND {deletedRelationships} AS rel MATCH ()-[rel]->(l:KVP) CALL apoc.log.info('Called delete on %s', [l {.key, .value}]) DETACH DELETE l RETURN null",
    { phase: "before" });
CALL apoc.trigger.add('deleteOrphanedSelectors',
  "UNWIND {deletedRelationships} AS rel MATCH ()-[rel]->(s:Selector) DETACH DELETE s RETURN null",
    { phase: "before" });

Steps (Mandatory)

1.MATCH (a:Resource {name: 'foo'}) DETACH DELETE a;

Specifications (Mandatory)

Currently used versions

Versions

  • OS: Linux (inside docker on a mac)
  • Neo4j: 3.5
  • Neo4j-Apoc: apoc-3.5.0.4-all.jar
@neo-technology-build-agent
Copy link
Collaborator Author

Comment by klongmitre
Thursday Jan 13, 2022 at 18:35 GMT


I'm seeing a similar problem where a SET on a node made inside a before trigger is not triggering another trigger that should be called when the field is changed. The second trigger does fire when I manually update the field. Have you been able to figure this out at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant