Open Uko opened 5 years ago
I don't know how described pattern is possible. Even if you have broken timer and dirty cache, it MUST return last successive promise.
I'd suggest to try this:
getUser(email)
is really a promise, not emulation with .then/.catch methodAny news? I tend to close as unclear and not confirmed.
Hi, I've spent quite some time debugging an issue in my app and it seems that there is a problem caused by memoization, and I would greatly appreciate any help to dig deeper.
My app runs on NodeJS 9.5. The main issue is that a memoized function never resolves, e.g.:
The issue does not occur constantly and kicks in only after the app is running for some time.
Upon further investigation (debugging of
memoizedFn
), I noticed that the values fromcache
are not cleared after a specified timeout (10sec). When I clean the cache manually all works well for some time. E.g.:A
,B
,C
, andD
;C
.C
all works as expected, the caching is happening and after 10 sec theC
key is removed.A
,B
, andD
persists as they are still in the cache, not removed automatically, and not resolving promises.I understand that that data I provided may be insufficient to identify the issue, but maybe you can suggest me where to look for more? For example, how can I compare what is the difference between a "healthy" key
C
and dead keysA
,B
,D
?