• I’m on the current version (Version 7.8.0.1) using Redis, but I think this has happened for a few versions.

    This has been driving me mad, because I thought it was some custom code I had written causing the problem. I completely refactored it, then disabled it entirely, and the bug was still there.

    When saving a product in WooCommerce, the product editor would reload with tags showing blank, both in the product form and the product list view. If you hit Purge All, or purged the object cache specifically, they would reappear. However, if you saved again before purging, the blank tags would be written to the database, so they were not just appearing deleted, they were actually being deleted.

    This caused tags to be randomly and silently wiped, but inconsistently enough that it took weeks to diagnose. The tags were correct in the database, but Redis was serving a blank cache entry for them after save. I was trawling through logs looking for something deleting the tags, when in reality nothing was. WooCommerce was simply reading the blank Redis cache on page reload and writing that empty state back to the database on the next save.

    The fix was adding product_tag_relationships to Do Not Cache Groups in the object cache settings. Tags now bypass Redis entirely and are always read from the database.

    This is a data loss bug. Users can silently lose taxonomy data with no indication anything is wrong.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support litetim

    (@litetim)

    @tecazwebdev We are sorry for the code you rewrote 🙂
    Do you use transients in the code you wrote?

    Plugin Support Hai Zheng⚡

    (@hailite)

    @litetim Can you make an auto test to reproduce this inconsistent issue so we can make sure the OC patch could work? It may be related to the cache_404 array not deleted when purging the product.

    Thread Starter Andrew Comb

    (@tecazwebdev)

    It was only inconsistent in the sense that only sometimes a user would make a product edit, then make another one just after, because they missed something. I frequently have to make purges to the site, so a lot of the times the stale cache was just purged, and no one noticed. Once I figured out the pattern, and what was broken, it’s pretty consistent to reproduce:

    Save a product – all product tags ‘gone’
    purge cache – product tags return
    Double save – product tags deleted

    My plugin code was adding an extra hooked save on publish, to store some hidden variables for a third party integration. I suspected my hook was somehow causing corruption through an undocumented WooCommerce behavior, so I refactored it to save those variables without involving the product form at all. The bug persisted, so I knew it wasn’t my code.

    No transients involved.

    Plugin Support litetim

    (@litetim)

    @tecazwebdev please help by sending a report to LiteSpeed. This can be done from LSC => Toolbox => Report => click on “Send to Litespeed”. A report ID will be generated and please share the ID. Thank you

    Thread Starter Andrew Comb

    (@tecazwebdev)

    NMDCCAOY

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.