{"action":"created","issue":{"url":"https://api.github.com/repos/apollographql/apollo-client/issues/2581","repository_url":"https://api.github.com/repos/apollographql/apollo-client","labels_url":"https://api.github.com/repos/apollographql/apollo-client/issues/2581/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/apollo-client/issues/2581/comments","events_url":"https://api.github.com/repos/apollographql/apollo-client/issues/2581/events","html_url":"https://github.com/apollographql/apollo-client/issues/2581","id":274660483,"number":2581,"title":"[2.0] subscribeToMore will stop to work | bug","user":{"login":"seeden","id":3958832,"avatar_url":"https://avatars3.githubusercontent.com/u/3958832?v=4","gravatar_id":"","url":"https://api.github.com/users/seeden","html_url":"https://github.com/seeden","followers_url":"https://api.github.com/users/seeden/followers","following_url":"https://api.github.com/users/seeden/following{/other_user}","gists_url":"https://api.github.com/users/seeden/gists{/gist_id}","starred_url":"https://api.github.com/users/seeden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seeden/subscriptions","organizations_url":"https://api.github.com/users/seeden/orgs","repos_url":"https://api.github.com/users/seeden/repos","events_url":"https://api.github.com/users/seeden/events{/privacy}","received_events_url":"https://api.github.com/users/seeden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-16T20:54:37Z","updated_at":"2017-11-17T20:18:13Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have simple react component with graphql decorator. When component was mounted I am doing subscribeToMore. I will receive first data but immediately after that subscription it stoped working. Component was not unmounted. Am I doing something wrong @jbaxleyiii ? Thank you\r\n\r\n```js\r\n@graphql(gql`\r\n  query getUserQuestions($username: String!) {\r\n    user(username: $username) {\r\n      id\r\n      questions {\r\n        edges {\r\n          node {\r\n            id\r\n            question\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n`, {\r\n  options: ({ match: { params: { username } } }) => ({\r\n    variables: {\r\n      username,\r\n    },\r\n  }),\r\n})\r\nclass Test extends Component {\r\n  componentWillMount() {\r\n    const { subscribeToMore, user } = this.props.data;\r\n\r\n    this.subscription = subscribeToMore({\r\n      document: SubscribeQuestionAddedQuery,\r\n      variables: {\r\n        username: user.username,\r\n      },\r\n      updateQuery: (prev, { subscriptionData }) => {\r\n        const { data } = subscriptionData;\r\n        if (data && data.questionAdded) {\r\n          this.questionAdded(data.questionAdded);\r\n        }\r\n        return prev;\r\n      },\r\n    });\r\n\r\n    console.log(this.subscription);\r\n  }\r\n  ...\r\n}\r\n```\r\n\r\nHere you can see frames from websocket:\r\n![websocket](https://i.imgur.com/6RA0w3B.png)\r\n\r\nAs you can see command \"stop\" is send after first data. Component was not unmount.\r\n\r\n```js\r\n    \"apollo-cache-inmemory\": \"^1.1.1\",\r\n    \"apollo-client\": \"^2.0.3\",\r\n    \"apollo-link\": \"^1.0.3\",\r\n    \"apollo-link-http\": \"^1.2.0\",\r\n    \"apollo-link-batch-http\": \"^1.0.1\",\r\n    \"apollo-link-retry\": \"^1.0.1\",\r\n    \"apollo-link-dedup\": \"^1.0.2\",\r\n    \"apollo-link-ws\": \"^1.0.1\",\r\n    \"apollo-utilities\": \"^1.0.2\",\r\n```"},"comment":{"url":"https://api.github.com/repos/apollographql/apollo-client/issues/comments/345354983","html_url":"https://github.com/apollographql/apollo-client/issues/2581#issuecomment-345354983","issue_url":"https://api.github.com/repos/apollographql/apollo-client/issues/2581","id":345354983,"user":{"login":"seeden","id":3958832,"avatar_url":"https://avatars3.githubusercontent.com/u/3958832?v=4","gravatar_id":"","url":"https://api.github.com/users/seeden","html_url":"https://github.com/seeden","followers_url":"https://api.github.com/users/seeden/followers","following_url":"https://api.github.com/users/seeden/following{/other_user}","gists_url":"https://api.github.com/users/seeden/gists{/gist_id}","starred_url":"https://api.github.com/users/seeden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seeden/subscriptions","organizations_url":"https://api.github.com/users/seeden/orgs","repos_url":"https://api.github.com/users/seeden/repos","events_url":"https://api.github.com/users/seeden/events{/privacy}","received_events_url":"https://api.github.com/users/seeden/received_events","type":"User","site_admin":false},"created_at":"2017-11-17T20:18:13Z","updated_at":"2017-11-17T20:18:13Z","author_association":"CONTRIBUTOR","body":"I did some research. The problem is in the apollo-link-dedup \r\nhttps://github.com/apollographql/apollo-link/blob/master/packages/apollo-link-dedup/src/dedupLink.ts#L73"}}
{"actor":{"display_login":"seeden"}}