{"action":"created","issue":{"url":"https://api.github.com/repos/realm/realm-js/issues/2052","repository_url":"https://api.github.com/repos/realm/realm-js","labels_url":"https://api.github.com/repos/realm/realm-js/issues/2052/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-js/issues/2052/comments","events_url":"https://api.github.com/repos/realm/realm-js/issues/2052/events","html_url":"https://github.com/realm/realm-js/issues/2052","id":367399539,"node_id":"MDU6SXNzdWUzNjczOTk1Mzk=","number":2052,"title":"Subscription enhancements request","user":{"login":"nirinchev","id":2315687,"node_id":"MDQ6VXNlcjIzMTU2ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/2315687?v=4","gravatar_id":"","url":"https://api.github.com/users/nirinchev","html_url":"https://github.com/nirinchev","followers_url":"https://api.github.com/users/nirinchev/followers","following_url":"https://api.github.com/users/nirinchev/following{/other_user}","gists_url":"https://api.github.com/users/nirinchev/gists{/gist_id}","starred_url":"https://api.github.com/users/nirinchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirinchev/subscriptions","organizations_url":"https://api.github.com/users/nirinchev/orgs","repos_url":"https://api.github.com/users/nirinchev/repos","events_url":"https://api.github.com/users/nirinchev/events{/privacy}","received_events_url":"https://api.github.com/users/nirinchev/received_events","type":"User","site_admin":false},"labels":[{"id":643640196,"node_id":"MDU6TGFiZWw2NDM2NDAxOTY=","url":"https://api.github.com/repos/realm/realm-js/labels/O:User%20PE/EE","name":"O:User PE/EE","color":"006b75","default":false},{"id":643640198,"node_id":"MDU6TGFiZWw2NDM2NDAxOTg=","url":"https://api.github.com/repos/realm/realm-js/labels/P:1%20Required","name":"P:1 Required","color":"bfdadc","default":false},{"id":247475511,"node_id":"MDU6TGFiZWwyNDc0NzU1MTE=","url":"https://api.github.com/repos/realm/realm-js/labels/T:Enhancement","name":"T:Enhancement","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":{"login":"kneth","id":1225363,"node_id":"MDQ6VXNlcjEyMjUzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1225363?v=4","gravatar_id":"","url":"https://api.github.com/users/kneth","html_url":"https://github.com/kneth","followers_url":"https://api.github.com/users/kneth/followers","following_url":"https://api.github.com/users/kneth/following{/other_user}","gists_url":"https://api.github.com/users/kneth/gists{/gist_id}","starred_url":"https://api.github.com/users/kneth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kneth/subscriptions","organizations_url":"https://api.github.com/users/kneth/orgs","repos_url":"https://api.github.com/users/kneth/repos","events_url":"https://api.github.com/users/kneth/events{/privacy}","received_events_url":"https://api.github.com/users/kneth/received_events","type":"User","site_admin":false},"assignees":[{"login":"kneth","id":1225363,"node_id":"MDQ6VXNlcjEyMjUzNjM=","avatar_url":"https://avatars0.githubusercontent.com/u/1225363?v=4","gravatar_id":"","url":"https://api.github.com/users/kneth","html_url":"https://github.com/kneth","followers_url":"https://api.github.com/users/kneth/followers","following_url":"https://api.github.com/users/kneth/following{/other_user}","gists_url":"https://api.github.com/users/kneth/gists{/gist_id}","starred_url":"https://api.github.com/users/kneth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kneth/subscriptions","organizations_url":"https://api.github.com/users/kneth/orgs","repos_url":"https://api.github.com/users/kneth/repos","events_url":"https://api.github.com/users/kneth/events{/privacy}","received_events_url":"https://api.github.com/users/kneth/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-10-05T23:36:51Z","updated_at":"2018-10-08T07:35:46Z","closed_at":null,"author_association":"MEMBER","body":"To provide a nicer subscribe/unsubscribe API in the GraphQL service, we need the following enhancements to the subscription functionality in realm-js:\r\n\r\n- [ ] Ability to unsubscribe by name. There should be no reason to subscribe to something only to later unsubscribe. \r\n- [ ] Ability to list all active subscriptions. We already have that information in the partial Realm, so there should be no reason not to expose it. I need just the name and the query and not a reference to the subscription instances or anything like that. \r\n- [ ] A nicer wrapper around waiting for subscription - something like:\r\n\r\n```js\r\nreturn new Promise((resolve, reject) => {\r\n  const listener = (__, state) => {\r\n    switch (state) {\r\n      case Realm.Sync.SubscriptionState.Complete:\r\n        subscription.removeListener(listener);\r\n        resolve();\r\n        break;\r\n      case Realm.Sync.SubscriptionState.Error:\r\n        subscription.removeListener(listener);\r\n        reject(subscription.error);\r\n        break;\r\n    }\r\n  };\r\n  subscription.addListener(listener);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/realm/realm-js/issues/comments/427743927","html_url":"https://github.com/realm/realm-js/issues/2052#issuecomment-427743927","issue_url":"https://api.github.com/repos/realm/realm-js/issues/2052","id":427743927,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzc0MzkyNw==","user":{"login":"nirinchev","id":2315687,"node_id":"MDQ6VXNlcjIzMTU2ODc=","avatar_url":"https://avatars1.githubusercontent.com/u/2315687?v=4","gravatar_id":"","url":"https://api.github.com/users/nirinchev","html_url":"https://github.com/nirinchev","followers_url":"https://api.github.com/users/nirinchev/followers","following_url":"https://api.github.com/users/nirinchev/following{/other_user}","gists_url":"https://api.github.com/users/nirinchev/gists{/gist_id}","starred_url":"https://api.github.com/users/nirinchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirinchev/subscriptions","organizations_url":"https://api.github.com/users/nirinchev/orgs","repos_url":"https://api.github.com/users/nirinchev/repos","events_url":"https://api.github.com/users/nirinchev/events{/privacy}","received_events_url":"https://api.github.com/users/nirinchev/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T07:35:46Z","updated_at":"2018-10-08T07:35:46Z","author_association":"MEMBER","body":"I'm not against that, but if we decide to do that, we should enhance the `Subscription` interface and add properties for the name and the serialized query. Otherwise it's fairly useless to get a list of these."}}
{"actor":{"display_login":"nirinchev"}}