Closed RealDolos closed 4 years ago
Thanks for the PR. Will release 1.0.7 in a few minutes. :+1:
Update tests
I knew I wanted to do something more before submitting the PR o_O
No problem, tests are a pain in the *** to update, I don't blame you :smile:
Problem
Date.now() - proxyObject.lastUpdateCheck > updateTimer
on every property access.lastUpdateCheck
starts out as 0 and is only updated on receiving achecking
event.checking
event is delayed by at least 200 ms in.checkUpdates()
(running after_wait(200)
)lastUpdateCheck
is still 0 during those first 200ms.Result
Process went up to consume 20GB of physical memory, swapping out most the physical memory of most other processes and eventually getting OOM killed by the kernel. Oops.
Fix
Remove the
lastUpdateCheck/checkUpdates()
calls from the proxy object completely. TheUpdateSubscriber
will perform these anyway already. No need to have this triggered on property access, kinda redundant.Also, move out the
proxyObject.subscriber
setup from the proxyget
into the mainwrapReader
body. No need to permanently check the creation when it's created exactly once anyway.Also,
triggerUpdate()
is useless; stubbed.