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

Subscription "delete-relationship" is not triggered by nested delete operations. #4527

Open
MacondoExpress opened this issue Jan 18, 2024 · 2 comments
Labels
bug report Something isn't working confirmed Confirmed bug
Projects

Comments

@MacondoExpress
Copy link
Contributor

Describe the bug
As for the title, subscription "delete_relationship" events are not triggered by the nested delete operations.

Type definitions

 type Actor {
    id: ID!
    movies: [Movie!]! @relationship(type: "ACTED_IN", direction: OUT)
}

type Movie {
    id: ID!
    actors: [Actor!]! @relationship(type: "ACTED_IN", direction: IN)
    workers: [Worker!]! @relationship(type: "WORKED_IN", direction: IN)
}

type Worker {
    id: ID!
    favoriteActors: [Actor!]! @relationship(type: "FAV", direction: OUT)
}

To Reproduce

Use the following dataset:

CREATE (a:Movie { id: "1" })
CREATE (b:Movie { id: "2" })
CREATE (a)<-[:ACTED_IN]-(c:Actor { id: "5" })
CREATE (b)<-[:WORKED_IN]-(d:Worker { id: "6" })
CREATE (c)<-[:FAV]-(d)

Expected behavior
With the following mutation:

mutation {
    deleteMovies(where: { id: "2" }, delete: { workers: {} })  {
        nodesDeleted
    }
}

I received 3 events:

[
  {
    "id": 1,
    "typename": "Movie",
    "timestamp": 1705608145930,
    "event": "delete",
    "properties": {
      "old": {
        "id": "2"
      },
      "new": undefined
    }
  },
  {
    "id": 3,
    "typename": "Worker",
    "timestamp": 1705608145930,
    "event": "delete",
    "properties": {
      "old": {
        "id": "6"
      },
      "new": undefined
    }
  },
  {
    "id": 1,
    "id_from": 3,
    "id_to": 1,
    "relationshipName": "WORKED_IN",
    "fromTypename": "Worker",
    "toTypename": "Movie",
    "timestamp": 1705608145930,
    "event": "delete_relationship",
    "properties": {
      "from": {
        "id": "6"
      },
      "to": {
        "id": "2"
      },
      "relationship": {}
    }
  }
]

As visible by the events received, there is no event about the deleted relationship FAV.

@MacondoExpress MacondoExpress added the bug report Something isn't working label Jan 18, 2024
@neo4j-team-graphql neo4j-team-graphql added this to Bug reports in Bug Triage Jan 18, 2024
@neo4j-team-graphql
Copy link
Collaborator

Many thanks for raising this bug report @MacondoExpress. 🐛 We will now attempt to reproduce the bug based on the steps you have provided.

Please ensure that you've provided the necessary information for a minimal reproduction, including but not limited to:

  • Type definitions
  • Resolvers
  • Query and/or Mutation (or multiple) needed to reproduce

If you have a support agreement with Neo4j, please link this GitHub issue to a new or existing Zendesk ticket.

Thanks again! 🙏

@mjfwebb mjfwebb moved this from Bug reports to Confirmed in Bug Triage Jan 23, 2024
@neo4j-team-graphql neo4j-team-graphql added the confirmed Confirmed bug label Jan 23, 2024
@neo4j-team-graphql
Copy link
Collaborator

We've been able to confirm this bug using the steps to reproduce that you provided - many thanks @MacondoExpress! 🙏 We will now prioritise the bug and address it appropriately.

@mjfwebb mjfwebb moved this from Confirmed to In progress in Bug Triage Jan 23, 2024
@MacondoExpress MacondoExpress moved this from In progress to Low priority in Bug Triage May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something isn't working confirmed Confirmed bug
Projects
Bug Triage
Low priority
Development

No branches or pull requests

2 participants