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

Delay not working by given date #6963

Closed
thirumanidev opened this issue May 4, 2022 · 2 comments
Closed

Delay not working by given date #6963

thirumanidev opened this issue May 4, 2022 · 2 comments

Comments

@thirumanidev
Copy link

thirumanidev commented May 4, 2022

Describe the bug

I tried the delay with PAST & FUTURE date. As per the examples described, it should trigger only for the past date, not on future date, but the console.log logging for the both dates. This examples taken from the official documentation only.
https://rxjs.dev/api/index/function/delay

Expected behavior

The delay should emit value for past date only, not on future date

Reproduction code

const date = new Date('March 15, 2050 12:00:00'); // in the FUTURE
const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date
delayedClicks.subscribe(x => console.log(x));

const date = new Date('March 15, 1050 12:00:00'); // in the PAST
const delayedClicks = clicks.pipe(delay(date)); // click emitted only after that date
delayedClicks.subscribe(x => console.log(x));

Reproduction URL

https://stackblitz.com/run?devtoolsheight=50

Version

7.5.6

Environment

No response

Additional context

No response

@voliva
Copy link
Contributor

voliva commented May 6, 2022

I think this is duplicate of #3015

Essentially the problem comes down to the runtime's setTimeout with big timeout values. Try this in your JS console:

setTimeout(() => console.log('bump'), 1_000_000_000_000)
// Immediately logs "bump"

You could say it's actually a JS Runtime bug. You'll need to guard against it yourself.

@jakovljevic-mladen
Copy link
Member

Duplicate of #3015. Thanks for reporting.

@jakovljevic-mladen jakovljevic-mladen closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2022
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