Graphcool / graphcool-framework

Apache License 2.0
1.77k stars 131 forks source link

Subscriptions are only working sporadically #557

Closed stefanoTron closed 6 years ago

stefanoTron commented 6 years ago

Current behavior Sometimes subscriptions work, sometimes they don't. There is no precise pattern. Our code has not changed in weeks, nor have our dependencies.

Reproduction Setup real-time subscriptions with Apollo (I'm using apollo-client 2.3.2), or use the Playground. Observe how sometimes nothing happens on a CREATE or a UPDATE mutation.

Expected behavior? When creating/updating a subscribed node, it should trigger a CREATE or UPDATE mutation, everytime in realtime.

Thanks

marktani commented 6 years ago

Thanks. Can you prepare a minimal setup for which you confirmed this to happen?

stefanoTron commented 6 years ago

1) In the console create a type like this:

type Post @model {
  id: ID! @isUnique
  title: String!
}

2) Manually, in the console, create two Posts, with as title Title1 and Title2

3) Then in the playground enter this and then execute:

subscription updatePost {
  Post(
    filter: {
      mutation_in: [UPDATED]
    }
  ) {
    mutation
    node {
      title
    }
  }
}

4) Now go and change Title1 to foo

5) Observe in the playground if anything happened. Sometimes it does, sometime it doesn't, you might have to change the title multiple times before the issue occurs or/and stop and start the subscription. In that case you have to repeat step 4, but instead of foo another value like foo2and so forth.

plinionaves commented 6 years ago

Same thing happening here.

stefanoTron commented 6 years ago

@marktani @dpetrick @nikolasburk @schickling this issue is still happening, is there anything we can do to help?

dpetrick commented 6 years ago

I'm investigating the issue and I'll try a few fixes over the next hour.

dpetrick commented 6 years ago

Fixed, closing this issue. Reopen if it happens again.

stefanoTron commented 6 years ago

thanks, let's hope it does not