colinmollenhour / Cm_Cache_Backend_Redis

A Zend_Cache backend for Redis with full support for tags (works great with Magento)
Other
390 stars 142 forks source link

Fix bug in lua clean script #163

Closed nemphys closed 3 years ago

nemphys commented 3 years ago

I am currently rewriting this in javascript for a Node project I am working on, and I just discovered a bug in the lua script for tag cleaning I committed 8 years ago(!):

since we are pre-processing the tags before passing them to the script, the last line of the script that removes the affected tags from the global tags list effectively does nothing (the tags in this list are not prefixed).

I have updated the script, so that the prefix addition happens inside it and is used for all operations except for the last one.

Better late than never, I suppose :-)

colinmollenhour commented 3 years ago

Wow, can't believe that was never noticed! Any idea why the unit tests don't fail?

boldhedgehog commented 3 years ago

Wow, can't believe that was never noticed! Any idea why the unit tests don't fail?

It only failed during runtime, that's why you can't use LUA for Magento 2: there are string indexes in the array.

colinmollenhour commented 3 years ago

Ahh, I see, the SUNION was working but the SREM was not. Thanks for the fix!