lentes
lentes copied to clipboard
Fix/mutable state bug
First, thank you for this library! I'm finding it useful.
There is a (very) subtle shared-state bug with the mutable cache fields which I fixed here
I don't have time to do this properly right now, though I would be happy to do so at some point... I didn't update the tests or even make sure that my changes were entirely necessary, but they do fix a nasty and subtle flaw which we ran into today using this library.
First of all, thanks for your time.
About the issue, after looking many times the code i don't see any relevant difference with the previous code:
-
zcache
is replacescache
but is used in the identical manner. -
zoldcache
is added, assigned to previous cache but not used. -
cache
seems that becomes unused. - only the deref impl is changed, other functions are untouched.
Can you explain please which bug is fixing this, because i don't understad that is intend to solve. Maybe you first need write a test case that reproduces the bug?
Yes, I'll be glad to put together a test case that shows the problem, but I will not be able to get to it right away.
@blak3mill3r I think you forgot about this