{"action":"created","issue":{"url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/300","repository_url":"https://api.github.com/repos/cult-of-coders/redis-oplog","labels_url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/300/labels{/name}","comments_url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/300/comments","events_url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/300/events","html_url":"https://github.com/cult-of-coders/redis-oplog/issues/300","id":382226908,"node_id":"MDU6SXNzdWUzODIyMjY5MDg=","number":300,"title":"Running 2 subscriptions on the same collection looses data","user":{"login":"Pagebakers","id":32583,"node_id":"MDQ6VXNlcjMyNTgz","avatar_url":"https://avatars0.githubusercontent.com/u/32583?v=4","gravatar_id":"","url":"https://api.github.com/users/Pagebakers","html_url":"https://github.com/Pagebakers","followers_url":"https://api.github.com/users/Pagebakers/followers","following_url":"https://api.github.com/users/Pagebakers/following{/other_user}","gists_url":"https://api.github.com/users/Pagebakers/gists{/gist_id}","starred_url":"https://api.github.com/users/Pagebakers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pagebakers/subscriptions","organizations_url":"https://api.github.com/users/Pagebakers/orgs","repos_url":"https://api.github.com/users/Pagebakers/repos","events_url":"https://api.github.com/users/Pagebakers/events{/privacy}","received_events_url":"https://api.github.com/users/Pagebakers/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-19T13:58:45Z","updated_at":"2018-11-20T07:35:23Z","closed_at":"2018-11-20T07:35:23Z","author_association":"NONE","body":"I'm running into issues where redis-oplog fails to publish items when you have multiple subscriptions active on the same collection.\r\n\r\nI have two collections:\r\n\r\nConversations\r\n  lastItemId -> ConversationItems._id\r\nConversationItems\r\n  conversationId -> Conversations._id\r\n\r\nThe lastMessageId is used to display the last message in the conversations list and is updated every time a new item is added to the conversation.\r\n\r\nThen there are 2 publications using Meteor.publishComposite\r\n\r\n```js\r\nMeteor.publishComposite('conversations', function () {\r\n  return {\r\n    find() {\r\n      return Conversations.find()\r\n    },\r\n    children: [{\r\n      find(conversation) {\r\n        return ConversationItems.find({\r\n          _id: conversation.lastItemId\r\n        })\r\n      }\r\n    }]\r\n  }\r\n})\r\n\r\nMeteor.publishComposite('conversation', function(_id) {\r\n  return {\r\n    find() {\r\n      return Conversations.find({\r\n        _id\r\n      })\r\n    },\r\n    children: [{\r\n      find(conversation) {\r\n        return ConversationItems.find({\r\n          conversationId: conversation._id\r\n        })\r\n      }\r\n    }]\r\n  }\r\n})\r\n```\r\n\r\nBoth publications are subscribed to on the same page, initially it seems to work fine. But after adding a few items and updating lastMessageId the 'conversation' publication stops publishing conversation items and only the lastItemId conversation item is published.\r\n\r\nHope this makes sense :)\r\n\r\nIs this a known issue? Let me know if you need more info.\r\n"},"comment":{"url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/comments/440172922","html_url":"https://github.com/cult-of-coders/redis-oplog/issues/300#issuecomment-440172922","issue_url":"https://api.github.com/repos/cult-of-coders/redis-oplog/issues/300","id":440172922,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDE3MjkyMg==","user":{"login":"Pagebakers","id":32583,"node_id":"MDQ6VXNlcjMyNTgz","avatar_url":"https://avatars0.githubusercontent.com/u/32583?v=4","gravatar_id":"","url":"https://api.github.com/users/Pagebakers","html_url":"https://github.com/Pagebakers","followers_url":"https://api.github.com/users/Pagebakers/followers","following_url":"https://api.github.com/users/Pagebakers/following{/other_user}","gists_url":"https://api.github.com/users/Pagebakers/gists{/gist_id}","starred_url":"https://api.github.com/users/Pagebakers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pagebakers/subscriptions","organizations_url":"https://api.github.com/users/Pagebakers/orgs","repos_url":"https://api.github.com/users/Pagebakers/repos","events_url":"https://api.github.com/users/Pagebakers/events{/privacy}","received_events_url":"https://api.github.com/users/Pagebakers/received_events","type":"User","site_admin":false},"created_at":"2018-11-20T07:35:23Z","updated_at":"2018-11-20T07:35:23Z","author_association":"NONE","body":"Thanks @ramezrafla \r\n\r\nThis is a simplified example of our setup. Right now we're just trying to make things work without changing too much of the original code.\r\n\r\nThe issue seemed to be related to collection2 not passing down options to the insert call on ConversationItems, there are a couple other issues around this.\r\n\r\nRunning on #283 now and it looks to be running smooth! Closing this for now :)"}}
{"actor":{"display_login":"Pagebakers"}}