Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Subscription for delete not working when scalar lists are present #838

Closed
cameronrll opened this issue Oct 16, 2017 · 8 comments
Closed
Assignees
Milestone

Comments

@cameronrll
Copy link

Subscription for delete is not working for only one of my schemas. This does not work in both my app and the playground

Schema: (names changed)

type MyModel @model {
  field1: String
  field2: String @isUnique
  field3: DateTime!
  field4: String
  field5: Boolean @defaultValue(value: false)
  field6: DateTime!
  field7: [String!]
  field8: Boolean @defaultValue(value: false)
  id: ID! @isUnique
  field9: Boolean! @defaultValue(value: false)
  field10: String
  field11: Month!
  field12: String
  field13: Int!
  field14: String!
  field15: String
  field16: String!
  field17: String!
  field18: Int!
  field19: Int
  field20: Int
  field21: Int
  field22: Season!
  field23: String!
  field24: String
  field25: DateTime
  field26: String
  field27: Int
  field28: String
  field29: String
  field30: String
  field31: DateTime!
  field32: Type
  field33: DateTime!
  field34: Period!
}

subscription

subscription MySub {
  MyModel(filter:{
    mutation_in: [DELETED, UPDATED, CREATED]
  }) {
    mutation
    previousValues {
      id
      ...
    }
    node {
      ...
   }
  }
}

I am not sure if this is a bug on my end or with graph.cool, however if I change the schema this sub is attached to, e.g. MyModel -> Messages it works as expected.

Any help would be great, thank you.

@marktani
Copy link
Contributor

I could not reproduce this issue in my own project. We're looking closer into @cameronrll project directly.

If someone can reproduce this in a new project, please share it here 🙂

@kristiansorens
Copy link

@marktani I have the same issue.

subscription { Place (filter: {mutation_in: [CREATED, UPDATED, DELETED]}){ mutation node { id name locationType cuisine foodDrinkType } } }

The above subscription triggers just fine on update and created, but it does not work for deleted events. Let me know if there is anything I can do to make it easier for you to debug.

@marktani
Copy link
Contributor

Let me know if there is anything I can do to make it easier for you to debug.

I'd be very interested to reproduce this in a new project. We're already looking into existing projects that show this behaviour to learn more about this.

@kristiansorens
Copy link

@marktani my project is fairly new - but I can try to set up a new test project - or would cloning the existing one count as a "new" project?

@marktani
Copy link
Contributor

or would cloning the existing one count as a "new" project?

No. If you could provide a

  • type definition
  • mutation
  • subscription

to reproduce this behaviour, that would be awesome 🙂 I was not able to come up with one.

@cameronrll
Copy link
Author

@marktani we believe we have tracked down the issue here. Once we removed

field7: [String!]

all worked as expected, and we could listen to the delete event. We've tried this both in a new and old project and the result seems to be the same.

Adding a [String!] field to any schema which could previously have the delete event picked up caused it to stop working

Adding new data once the change had been made, meant the new data (created after the addition of [String!]) would not be picked up when deleted, but data before the addition of the [String!] field to the schema would be picked up

@cameronrll
Copy link
Author

Also the form

field: [String!]!

also seems to cause the same issues with the delete event

@dpetrick dpetrick self-assigned this Oct 17, 2017
@marktani marktani added this to the 0.8 milestone Oct 17, 2017
@dpetrick
Copy link
Contributor

This should be fixed.

@marktani marktani changed the title Subscription for delete not working Subscription for delete not working when scalar lists are present Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants