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

interval with large period keeps emitting #4495

Closed
cec opened this issue Jan 25, 2019 · 1 comment
Closed

interval with large period keeps emitting #4495

cec opened this issue Jan 25, 2019 · 1 comment

Comments

@cec
Copy link

cec commented Jan 25, 2019

Bug Report

Current Behavior
Passing a large period to interval(period: number, scheduler: Scheduler): Observable results in continuous emissions instead of 1 after given period passed.

Reproduction
Sadly I can't provide a StackBlitz due to corporate firewall issues, but I managed to reproduce the problem here using rxjs-playground.github.io.

I'm posting the same code here:

var largePeriod = 2240240746; // roughly 26 days in milliseconds
Rx.Observable.interval(largePeriod).subscribe(val => console.log(val))

Expected behavior
The Observable should not emit until given period has passed.

Environment

  • Windows 10
  • Runtime: Node 8.9.4, Chrome 71.0.3578.98
  • RxJS version: 6.2.2

Additional info
I know that the such a large period is very awkward. I'm getting such a large value from a backend system telling me that the time-window for a given operation expires at some point in the future.

As a workaround I can pass to interval min(backendValue, largestPeriodNotExposingThisBug), but I believe it is right to inform you about this to prevent more problematic issues.

@kwonoj
Copy link
Member

kwonoj commented Jan 25, 2019

check #3015 , mostly same crux as we use javascript's timeout / interval.

@kwonoj kwonoj closed this as completed Jan 25, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 24, 2019
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

2 participants