Describe the bug
When you use redis object cache using any of the various object caching plugins, addToCart Mutation gets stuck in an infinite loop.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should not get stuck
With the help of xdebug I located the problem spot - https://github.com/wp-graphql/wp-graphql-woocommerce/blob/b3c649da671bed974ff66b1b4e78012304e8c8f1/includes/utils/class-ql-session-handler.php#L147. It seems like transaction queue doesn't change.
@dpacmittal Could you contact me in the WPGraphQL slack? I want to speak some more on your setup.
@kidunot89 running into this same behavior as well - FYI. Same repro steps. Besides the addToCart mutation hanging indefinitely, the cart query also hangs.
@jacobarriola As a workaround, you can ignore the woo_session_transactions_queue cache group:
define('WP_REDIS_IGNORED_GROUPS', [
"counts",
"plugins",
"themes",
"woo_session_transactions_queue"
]);
@dpacmittal @jacobarriola The problem seems to be that the old transaction IDs aren't always being popped off the queue. I'm working on a patch that invalidates these stale transaction IDs after a period of time. That should remedy this issue.
@dpacmittal Could you try and review this PR #398 ? If it works we can get it merged.
Sorry for the delay :sweat_smile:
Most helpful comment
@dpacmittal @jacobarriola The problem seems to be that the old transaction IDs aren't always being popped off the queue. I'm working on a patch that invalidates these stale transaction IDs after a period of time. That should remedy this issue.