kloon / woocommerce-large-sessions

Offloads WooCommerce sessions from the wp_options table to a custom table with wp_cache functionality built ontop.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Carts not being cleared from object cache

pmgarman opened this issue · comments

When running with an object cache in place the cart isn't getting cleared upon checkout. I'm not entirely sure why this is happening, but by commenting out the wp_cache_* calls and forcing the MySQL connection for session it cleared up the issue. I can't see a reason why the code WOULDN'T work as is, so it could very well be server level issue but want to log it here. The issue we're having is on WPE, which I believe you may have tested on as well.

Hey Patrick, not getting the same results locally with object cache enabled or on our site which also runs on WPEngine. I would check the order status and perhaps the payment gateway you are using as those could be factors that is causing this.

Using Auth.net AIM from SkyVerge, also happened when using PayPal, and Chech gateways. I don't think it's gateway related due to that. Happy to get access to our staging site or something if you want to poke it a bit.

Steps I took to reproduce

  1. Add items to cart
  2. Go to cart
  3. Go to checkout
  4. Choose PayPal as gateway
  5. Click Place Order
  6. Go back to cart

As is items were still in cart, removing wp_cache_* from the code, cart would be empty.

I'll add - this issue existed with https://github.com/deltafactory/woocommerce-session-table-handler as well. I think it went away when I deactivated all table based sessions type plugins (I never ran them at the same time of course) and the wp_options table was being used, but lots of other testing has happened since then so I'm not 100% confident. We can always retest it :)

@pmgarman Just reading about this now. Filing an issue next time would be appreciated. :)

While I remember this issue in testing, we weren't aware of issues with this in production. I don't know which version you were using, though it seems like this is moot.

@deltafactory sorry about that! The only reason I had not is I had heard reports that the issue didn't exist for a few others and it may have been related to our setup. The same issue was appearing on two different plugins, one of which was running on woothemes.com which should be a close setup to our own and yet not having an issue... so just took out the wp_cache_* calls myself and kept on going ha!

FWIW, I believe the issue was related to timing and writing the updated cache values during the do_action( 'shutdown') though I never found the exact cause. I fixed it by not updating but deleting the cached item and letting it refresh during a subsequent page load.

I had - that's why I was poking around related issues. I'm glad to know you were able to use my implementation in the interim and it would've been cool to have it included in core but that ship has sailed. :)