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

auditTime(0, animationFrameScheduler) stops emiting unexpectedly. #7096

Open
fdeslandes-wk opened this issue Oct 21, 2022 · 4 comments
Open

Comments

@fdeslandes-wk
Copy link

fdeslandes-wk commented Oct 21, 2022

Describe the bug

Since version 7.5.0, there is a weird interaction between different observables using animationFrameScheduler, especially auditTime(0, animationFrameScheduler), which stops emitting when other observables using the animationFrameScheduler started concludes after the first event is sent to the audit.

This causes problems with Angular CDK virtual scroll viewport which stops working when other things in the application use the animationFrameScheduler on observables which concludes.

It seems related to the same changes which caused #7017.

Expected behavior

Other observables should not have side effects on the animationFrameScheduler Action from auditTime(0, animationFrameScheduler) and auditTime should keep emitting regardless of the recycling of animationFrameScheduler actions.

Reproduction code

See the StackBlitz code, which reproduces the issue.  The issue cannot be reproduced using rxJs 7.4.x. It is there since 7.5.x.

Reproduction URL

https://rxjs-afsbug-s5ubbu.stackblitz.io

https://stackblitz.com/edit/rxjs-afsbug-s5ubbu?file=index.ts

Version

7.5.0 - 7.5.7

Environment

Reproduced in Chrome and Firefox. If you cannot reproduce, try throttling CPU in the Chrome DevTools.

Additional context

No response

@gabrielgagne
Copy link

Same problem here

@endoffline
Copy link

We also have the same problem. In my case it leads to the Angular CDK virtual scroll viewport to not render the necessary elements which would be visible within the current viewport, as scroll events are not processed any longer.

@gabrielgagne
Copy link

Yes, I noticed this bug too after seeing cdk virtual scroll (and our other component relying on animationFrameScheduler) being messed up after updating past 7.4

@endoffline
Copy link

I've expanded the example @fdeslandes-wk and included the cdk-virtual-scroll-viewport to highlight the problem more prominently.

Have a look here: https://stackblitz.com/edit/angular-zdbuly?file=src%2Fmain.ts

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

No branches or pull requests

3 participants