-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
while waiting for promise to resolve, maxAge is Number.POSITIVE_INFINITY which breaks mapAgeCleaner #39
Comments
// @niksy |
I don’t know if we should fix this here or in @dylang Do you have reproducible test case so we can create test for it? |
Hi @niksy - thanks for taking a look at this. Here's a minimal reproducible case: https://stackblitz.com/edit/p-memoize-issues-39?file=index.js I agree Maybe we could use BTW, it seems that removing |
Unfortunately, |
Sounds good to me 👍 Happy new year 🎉 |
@sindresorhus done! And happy new year to you all! |
Version
This is from
p-memoize@4.0.3
and possibly caused by #37.Stack
Theory
maxAge
toNumber.POSITIVE_INFINITY
. https://github.com/sindresorhus/p-memoize/blob/version-4/index.js#L29pSettle
is resolved (https://github.com/sindresorhus/p-memoize/blob/version-4/index.js#L32)maxAge
will continue to beNumber.POSITIVE_INFINITY
.mapAgeCleaner
is run. https://github.com/sindresorhus/p-memoize/blob/version-4/index.js#L13mapAgeCleaner
does not check ifmaxAge
is a safe integer. It usessetTimeout(..., maxAge)
.maxAge
to an integer), thensetTimeout
throws the above stack becauseNumber.POSITIVE_INFINITY
is not a 32 bit number.The text was updated successfully, but these errors were encountered: