Skip to content

Possible renewal issues when both active/inactive roles are same and object cache is in use #754

Open
@kaushikasomaiya

Description

9181793-zen

I haven't been able to replicate this on my own site with memcache set on localhost.

Merchant is using Subs + APFS and site is hosted on Site ground with Memcache enabled.

The renewals were getting generated with pending status but not being charged via Square CC. No order notes on the renewal order.

Upon investigating, it came out that

  • Both active / inactive role were set to "customer"
  • Subs goes on hold -> triggers role change
  • It removes the old role "customer"
  • When it attempts to assign back the same role, the object cache throws same value here and no DB update occur causing the user to stay with no role set

/wp-includes/meta.php (line 240 around)

	// Compare existing value to new value if no prev value given and the key exists only once.
	if ( empty( $prev_value ) ) {
		$old_value = get_metadata_raw( $meta_type, $object_id, $meta_key );
		if ( is_countable( $old_value ) && count( $old_value ) === 1 ) {
			if ( $old_value[0] === $meta_value ) {
				return false;
			}
		}
	}
  • further it occurs that woocommerce_scheduled_subscription_payment_square_credit_card is not being fired at all.
  • At this point I am not sure if the role issue could be affecting things further. I did not spot any sort of PHP error and the SA finishes successfully making me suspect either the role issue is halting the renewal or something else causes the gateway_scheduled_subscription_payment() function to exit silently due to memcache enabled.

Disabling the memcache on Siteground seems to have fixed both issues - role being unset and renewal halting silently

Metadata

Assignees

No one assigned

    Labels

    type: bugThe issue is a confirmed bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions