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

Component-store: Debounce stops working correctly with RXJS 7.5.x #3554

Closed
1 of 2 tasks
aldrashan opened this issue Aug 30, 2022 · 9 comments
Closed
1 of 2 tasks

Component-store: Debounce stops working correctly with RXJS 7.5.x #3554

aldrashan opened this issue Aug 30, 2022 · 9 comments

Comments

@aldrashan
Copy link

aldrashan commented Aug 30, 2022

Minimal reproduction of the bug/regression with instructions

Will try to create a minimal example that displays the problem later.
Our code library isn't quickly exportable right now.
https://stackblitz.com/edit/rxjs-htf8tz?file=index.ts should show this as well (from the issue linked below).

Minimal reproduction of the bug/regression with instructions

See ReactiveX/rxjs#6747.
I too traced our issues down to the asapScheduler that's used in the debounceSync function.
https://github.com/ngrx/platform/blob/master/modules/component-store/src/debounce-sync.ts
-> Line 53: observer.next(actionValue); is never hit in some cases

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx: 14
Angular: 14
Node: n/a
Browsers: n/a
OS: n/a

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@alex-okrushko
Copy link
Member

I don't think we can do anything about it - it's a broken upstream dependency.

@markostanimirovic
Copy link
Member

Replacing asapScheduler.schedule with queueMicrotask would most likely solve this issue. If the asapScheduler bug is not resolved soon, we can investigate alternatives.

@brandonroberts brandonroberts added the Blocked (External) Blocked by external package label Sep 8, 2022
@Samoji
Copy link

Samoji commented Nov 3, 2022

Any updates on this issue?
What's the recommended workaround? { debounce: false }?

Thanks

@aldrashan
Copy link
Author

Any updates on this issue? What's the recommended workaround? { debounce: false }?

Thanks

Debounce: false isn't really a valid workaround, since you're changing how the code works. If it works without debouncing, you didn't need it to begin with.

The people from rxjs closed the issue about what was/is causing problems, since it "should" be fixed starting from 7.5.7, but this is still not the case for our project.

@thomastrapanese
Copy link

Any update?

@aldrashan
Copy link
Author

Any update?

They (the people from rxjs) have -allegedly- fixed it for their next release but it hasn't come out yet.
Should be fairly soon, seeing how they've been releasing a new version every 2-4 months and it's been 3 months.
They were also planning on porting the fix to older rxjs versions as well, so fingers crossed until their next release, I guess.

@thomastrapanese
Copy link

Thank you @aldrashan

@aldrashan
Copy link
Author

@thomastrapanese
Rxjs version 7.8.1 came out a few hours ago.
Seems fixed after some preliminary testing.
Will close this issue in a few days if we don't encounter any more problems.

@markostanimirovic
Copy link
Member

It seems this issue is fixed in RxJS v7.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants