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

Subscription's filters don't have any effect #567

Closed
damien-monni opened this issue Sep 17, 2017 · 4 comments
Closed

Subscription's filters don't have any effect #567

damien-monni opened this issue Sep 17, 2017 · 4 comments

Comments

@damien-monni
Copy link

What is the current behavior?

When subscribing using a filter, the filter is not working and we are receiving everything that is created.

Please share the relevant part of your project (GraphQL schema, functions, permissions, ...) for easier reproduction

I am using the freecom example from graphcool, part 5.
You can reproduce the error using the following process:

  • Open the following link in 2 different browsers on 2 different networks, for exemple on your computer wich is on a Wifi network and on your mobile which is using 3G data: https://freecom.netlify.com/

  • Send a message from both browsers, you will see your message from one browser apearing in the other one. For me, the issue seems to apear when I send a message from the 2nd browser I opened (my mobile on 3G network, then the message is also apearing on my computer).

If applicable, share the query, mutation or subscription for reproduction

The query is the one used in the freecom application part 5:

const newMessageSubscription = gql`
  subscription newMessageSubscription($conversationId: ID!) {
    Message(
      filter: {
        AND: [
          { mutation_in: [CREATED] }
          { node: { conversation: { id: $conversationId } } }
        ]
      }
    ) {
      node {
        id
        text
        createdAt
        agent {
          id
          slackUserName
          imageUrl
        }
      }
    }
  }
`;

What is the expected behavior?
I should not see the message send from my mobile in any other app (like the one opened in my computer)

@marktani
Copy link
Contributor

Thanks, I can reproduce the problem. We'll look into this as soon as possible 🙂

@dpetrick dpetrick self-assigned this Sep 18, 2017
@marktani marktani changed the title Subscription's filters have any effect Subscription's filters don't have any effect Sep 19, 2017
@parronGroupnote
Copy link

Same here but sometimes returns everything and sometimes anything. It is a very unpredictable behaviour

@marktani
Copy link
Contributor

Thanks, we're currently investigating a problem with subscriptions when variables are present - will keep this thread posted with updates 🙂

@marktani
Copy link
Contributor

marktani commented Sep 21, 2017

This is now fixed - thanks a lot for bringing this up! 🙂

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