ReactiveX / ReactiveX/rxjs

auditTime(0, animationFrameScheduler) stops emiting unexpectedly.

Open
#7,096 8 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
31.7k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

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 https://github.com/ReactiveX/rxjs/issues/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and compare behavior between RxJS 7.4.x and 7.5.x, then trace auditTime(0, animationFrameScheduler) and the animationFrameScheduler action lifecycle. Done means auditTime continues emitting when other observables using the scheduler conclude, matching the expected behavior in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.