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

distinctUntilChanged operator not working #2980

Closed
Tiedye opened this issue Oct 19, 2017 · 10 comments
Closed

distinctUntilChanged operator not working #2980

Tiedye opened this issue Oct 19, 2017 · 10 comments

Comments

@Tiedye
Copy link

Tiedye commented Oct 19, 2017

RxJS version: 5.5.0

Code to reproduce:

Observable.of('66e4b95a-5277-4930-bae0-0c7a55c982b3', '66e4b95a-5277-4930-bae0-0c7a55c982b3')
    .distinctUntilChanged()
    .subscribe(x => console.log(x));

Expected behavior:
The code should only print once.

Actual behavior:
It prints twice.

Additional information:
I haven't been able to test that example code specifically for this issue, its occuring in a angular component in this code:

      route.params.filter(params => params['id'] != null).map(params => <string>params['id']).distinctUntilChanged().do(id => {
        store.dispatch(new guard.FetchOneAction(id));
        this.resetChanges(id);
      })

And I've check before and after the distincUntilChanged the value in the pipe, and I am absolutely certain that there are no values being passed between the two identical strings. If anyone has a good plunker template for rxjs I could make a plunker (I dont have time rn to do it myself)

@montella1507
Copy link

There are several critical issues in 5.5.0:
#2977

@Tiedye
Copy link
Author

Tiedye commented Oct 19, 2017

Alright, so downgrade for the time being?

@montella1507
Copy link

I would say yes. We did not upgrade to 5.5.0, unfortunately everywhere is "range cavet" version (in our case we had ^5.4.3 so it has been automatically updated to 5.5.0). Change to pinned version 5.4.3 fixed all problems.

@kwonoj
Copy link
Member

kwonoj commented Oct 19, 2017

I don't think it's related with 5.5 and I just confirmed operator itself behaves same as before - like below output.

image

Please provide reproducible code, without framework is involved. Plain node based github repo is usually best.

@montella1507
Copy link

@kwonoj well.. it is not so easy to detect which is involved in our errors - i cannot simulate the problem in pure rxjs, i tried today. :-/

Is it possible to try reproduce steps here:
angular/angular#19799

i dont want you to debug my application, just to start one run, maybe rxjs 5.5.0 is in conflift with zone.js ?

@kwonoj
Copy link
Member

kwonoj commented Oct 20, 2017

I can't guess, or debug into code you've posted in issue you shared. Except module loading ergonomics, operator side 5.5 has not changed especially specific operator in this issue, also isolated code works fine reason I think this is application side issue instead of library side issue. I'll keep opening issue, but can't say I can dig this with current state.

@montella1507
Copy link

montella1507 commented Oct 20, 2017

@kwonoj ok, unfortunately i am not able to debug it, i think it needs strong knowledge of how Angular (maybe zone.js breaks rxjs)+angular-cli work (atleast in my case, i cannot tell everyone else is using any framework), so i can only wait for response from angular team.

I have just hoped you would be able to detect the issue, because there are only rxjs calls in callstack.. However i know it very difficult, because everything can change (monkeypatch) anything and conflict anything... :-(

@Tiedye
Copy link
Author

Tiedye commented Oct 20, 2017

Found the issue, there was an additional subscription in my code that I had forgotten about, sorry to bother you. share solved the issue.

@Tiedye Tiedye closed this as completed Oct 20, 2017
@Tiedye
Copy link
Author

Tiedye commented Oct 20, 2017

That took waaaay to long to figure out.

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants