{"action":"created","issue":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1041","labels_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1041/labels{/name}","comments_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1041/comments","events_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1041/events","html_url":"https://github.com/ReactiveX/RxJS/issues/1041","id":121675579,"number":1041,"title":"Repeat and retry bugging on synchronous sources","user":{"login":"staltz","id":90512,"avatar_url":"https://avatars.githubusercontent.com/u/90512?v=3","gravatar_id":"","url":"https://api.github.com/users/staltz","html_url":"https://github.com/staltz","followers_url":"https://api.github.com/users/staltz/followers","following_url":"https://api.github.com/users/staltz/following{/other_user}","gists_url":"https://api.github.com/users/staltz/gists{/gist_id}","starred_url":"https://api.github.com/users/staltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staltz/subscriptions","organizations_url":"https://api.github.com/users/staltz/orgs","repos_url":"https://api.github.com/users/staltz/repos","events_url":"https://api.github.com/users/staltz/events{/privacy}","received_events_url":"https://api.github.com/users/staltz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-11T09:58:45Z","updated_at":"2015-12-11T11:25:32Z","closed_at":null,"body":"This happens:\r\n```js\r\nRx.Observable.of(10,20,30)\r\n  .concat(Rx.Observable.throw('poop'))\r\n  .multicast(() => new Rx.ReplaySubject(2))\r\n  .refCount()\r\n  .retry(5)\r\n  .subscribe(x => console.log(x), e => console.error(e), () => console.info('|'));\r\n\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n```\r\n\r\nAnd this:\r\n```js\r\nRx.Observable.of(10,20,30)\r\n  .multicast(() => new Rx.ReplaySubject(2))\r\n  .refCount()\r\n  .repeat(5)\r\n  .subscribe(x => console.log(x), e => console.error(e), () => console.info('|'));\r\n\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n```\r\n\r\nThe bug manifests itself only for `repeat(x)` where `x >= 3`, and `retry(x)` where `x >= 2`."},"comment":{"url":"https://api.github.com/repos/ReactiveX/RxJS/issues/comments/163914882","html_url":"https://github.com/ReactiveX/RxJS/issues/1041#issuecomment-163914882","issue_url":"https://api.github.com/repos/ReactiveX/RxJS/issues/1041","id":163914882,"user":{"login":"staltz","id":90512,"avatar_url":"https://avatars.githubusercontent.com/u/90512?v=3","gravatar_id":"","url":"https://api.github.com/users/staltz","html_url":"https://github.com/staltz","followers_url":"https://api.github.com/users/staltz/followers","following_url":"https://api.github.com/users/staltz/following{/other_user}","gists_url":"https://api.github.com/users/staltz/gists{/gist_id}","starred_url":"https://api.github.com/users/staltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staltz/subscriptions","organizations_url":"https://api.github.com/users/staltz/orgs","repos_url":"https://api.github.com/users/staltz/repos","events_url":"https://api.github.com/users/staltz/events{/privacy}","received_events_url":"https://api.github.com/users/staltz/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T11:25:32Z","updated_at":"2015-12-11T11:25:32Z","body":"It's a problem with multicast and refCount, since this works:\r\n\r\n```js\r\nRx.Observable.of(10,20,30)\r\n  .concat(Rx.Observable.throw('poop'))\r\n  .retry(4)\r\n  .subscribe(x => console.log(x), e => console.error(e), () => console.info('|'));\r\n\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n// 10\r\n// 20\r\n// 30\r\n// poop\r\n```"}}