You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use a delay in a pipe that was supposed to trigger on the expiration of a JWT. The token had an expiration of 30 days from the moment it was released.
If the expiration is longer than 24.9 days (2147483648 ms), the those operators will not wait the proper amount of time.
I think this is due the fact that internally they are all using the setInterval function (?) that apparently has a cap to a 32 bit integer, corresponding to 2147483648 ms, namely 24.9 days.
This is also broken when passing a Date, which I think is converted back to milliseconds at some point.
I am fine with this limitations, but in the documentation there is no mention to this, and moreover there are examples where the delay is much longer than 25 days (like here there is an example with a date set to the year 2050).
Also, with using as possible input a date, it does not encourage at all these types of checks from the developer side, leading to very edge-cases bugs that can be quite tricky to track.
Expected behavior
When I create a timer or use a delay operator with a date set to 2050 I expect that the pipe will not trigger (or continue) until that specified date (or amount of time in case of milliseconds are passed).
Reproduction code
// Set the date as 30 days from todaytimer(newDate('March 12, 2024 12:00:00')).subscribe(()=>console.log("Time flies!"))
Describe the bug
I was trying to use a delay in a pipe that was supposed to trigger on the expiration of a JWT. The token had an expiration of 30 days from the moment it was released.
If the expiration is longer than 24.9 days (2147483648 ms), the those operators will not wait the proper amount of time.
I think this is due the fact that internally they are all using the setInterval function (?) that apparently has a cap to a 32 bit integer, corresponding to 2147483648 ms, namely 24.9 days.
This is also broken when passing a Date, which I think is converted back to milliseconds at some point.
I am fine with this limitations, but in the documentation there is no mention to this, and moreover there are examples where the delay is much longer than 25 days (like here there is an example with a date set to the year 2050).
Also, with using as possible input a date, it does not encourage at all these types of checks from the developer side, leading to very edge-cases bugs that can be quite tricky to track.
Expected behavior
When I create a timer or use a delay operator with a date set to 2050 I expect that the pipe will not trigger (or continue) until that specified date (or amount of time in case of milliseconds are passed).
Reproduction code
Reproduction URL
https://stackblitz.com/edit/rxjs-mrjeaj?file=index.ts
Version
7.8.0
Environment
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: