Skip to content

interval with large period keeps emitting #4495

Closed
@cec

Description

@cec

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions