Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second subscription to the same observable is not starting a sequence if the observable was built from a typed array #2496

Closed
Roman-Sky opened this issue Mar 27, 2017 · 2 comments · Fixed by #2497 or Xenira/Shashki#66
Labels
bug Confirmed bug

Comments

@Roman-Sky
Copy link

RxJS version:
5.2.0

Code to reproduce:

let x_source = [1,2];
let x_obs = Rx.Observable.from(x_source);
let x_obs1 = x_obs.map(v => `x_obs1: ${v}`).subscribe(console.log);
let x_obs2 = x_obs.map(v => `x_obs2: ${v}`).subscribe(console.log);

let y_source = new Int32Array([1,2]);
let y_obs = Rx.Observable.from(y_source);
let y_obs1 = y_obs.map(v => `Int32Array 1st observer: ${v}`).subscribe(console.log);
let y_obs2 = y_obs.map(v => `Int32Array 2nd observer: ${v}`).subscribe(console.log);

Expected behavior:

x_obs1: 1
x_obs1: 2
x_obs2: 1
x_obs2: 2
Int32Array 1st observer: 1
Int32Array 1st observer: 2
Int32Array 2nd observer: 1
Int32Array 2nd observer: 2

Actual behavior:

x_obs1: 1
x_obs1: 2
x_obs2: 1
x_obs2: 2
Int32Array 1st observer: 1
Int32Array 1st observer: 2

Additional information:
For some reason, subscribing to an observable, that is built from typed array (Int32Arrat, Float32Array, etc), in the 2nd time is not initiates a sequence. The 1st subscription is working well.
Observables built from classic arrays don't have such behavior.

@kwonoj kwonoj added the bug Confirmed bug label Mar 27, 2017
@kwonoj
Copy link
Member

kwonoj commented Mar 27, 2017

This seems bug how Rx does handle native iterator. I'll prep fix shortly.

kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 27, 2017
kwonoj added a commit to kwonoj/rxjs that referenced this issue Jun 15, 2017
kwonoj added a commit to kwonoj/rxjs that referenced this issue Jun 15, 2017
kwonoj added a commit to kwonoj/rxjs that referenced this issue Aug 15, 2017
kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 27, 2017
kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 27, 2017
BREAKING CHANGE: IteratorObservable no longer share iterator between
subscription

- closes ReactiveX#2496
kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 27, 2017
BREAKING CHANGE: IteratorObservable no longer share iterator between
subscription

- closes ReactiveX#2496
benlesh pushed a commit that referenced this issue Oct 30, 2017
BREAKING CHANGE: IteratorObservable no longer share iterator between
subscription

- closes #2496
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Confirmed bug
Projects
None yet
2 participants