lentes icon indicating copy to clipboard operation
lentes copied to clipboard

Fix/mutable state bug

Open blak3mill3r opened this issue 6 years ago • 3 comments

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.

blak3mill3r avatar Jun 06 '18 02:06 blak3mill3r

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 replaces cache 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?

niwinz avatar Jun 06 '18 07:06 niwinz

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 avatar Jun 07 '18 05:06 blak3mill3r

@blak3mill3r I think you forgot about this

epeters-jrmngndr avatar Oct 29 '20 19:10 epeters-jrmngndr