platform
platform copied to clipboard
Component-store: Debounce stops working correctly with RXJS 7.5.x
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 https://github.com/ReactiveX/rxjs/issues/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
- [X] No
I don't think we can do anything about it - it's a broken upstream dependency.
Replacing asapScheduler.schedule
with queueMicrotask
would most likely solve this issue. If the asapScheduler
bug is not resolved soon, we can investigate alternatives.
Any updates on this issue? What's the recommended workaround? { debounce: false }?
Thanks
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.
Any update?
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.
Thank you @aldrashan
@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.
It seems this issue is fixed in RxJS v7.8.1.