You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using both the Woocommerce Memberships plugin with GraphQL Woocommerce an infinite loop can occur when a user who has not already been authenticated by WordPress clicks on a transfer session link ex: https://wp.local/transfer-session?session_id=xxxxx&_wc_checkout=xxxxxx
To Reproduce
Steps to reproduce the behavior:
Have both plugins active
User must not be currently logged into WP
Retrieve a checkoutUrl from customer field via GraphQL-woocommerce
Click on a transfer session link
Infinite loop should occur
Expected behavior
Infinite loops should not trigger while process_auth_request is executing
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: MacOs Ventura 13.6.1
Browser Chrome Version 124.0.6367.62 (Official Build) (arm64)
Smartphone (please complete the following information):
process_auth_request will call eventually wc_get_endpoint_url
wc_get_endpoint_url will eventually trigger the woocommerce_get_query_vars filter
This filter will trigger WC_Memberships::add_query_vars()
WC_Memberships will eventually make a query which will fire pre_get_posts filter
WooGraphQL will fire resolve_request() on the pre_get_posts filter since its priority 1
resolve_request() will eventually call process_auth_request and now we're in an infinite loop
Using the Woocommerce Memberships plugin in conjunction with Woocommerce Subscriptions is a pretty common use-case. In my specific enviroment I retrieving the checkoutUrl for use in a headless react app, therefore our users would not be already authenticated with WordPress. The check in process_auth_request (line 343) does not trigger this issue and the request resolves normally.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using both the Woocommerce Memberships plugin with GraphQL Woocommerce an infinite loop can occur when a user who has not already been authenticated by WordPress clicks on a transfer session link ex:
https://wp.local/transfer-session?session_id=xxxxx&_wc_checkout=xxxxxx
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Infinite loops should not trigger while
process_auth_request
is executingScreenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Plugin Versions
Additional context
Here is a pastebin of the stack trace before xdebug bails
https://pastebin.com/6YcbV9iR
What I've determined is that
process_auth_request
will call eventuallywc_get_endpoint_url
wc_get_endpoint_url
will eventually trigger thewoocommerce_get_query_vars
filterWC_Memberships::add_query_vars()
pre_get_posts
filterresolve_request()
on thepre_get_posts
filter since its priority1
resolve_request()
will eventually callprocess_auth_request
and now we're in an infinite loopUsing the Woocommerce Memberships plugin in conjunction with Woocommerce Subscriptions is a pretty common use-case. In my specific enviroment I retrieving the checkoutUrl for use in a headless react app, therefore our users would not be already authenticated with WordPress. The check in
process_auth_request
(line 343) does not trigger this issue and the request resolves normally.The text was updated successfully, but these errors were encountered: