New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent stores from calling helper API when local cache is not functioning #36846
Draft
thilinah
wants to merge
6
commits into
trunk
Choose a base branch
from
fix/helper-api-usage-when-cache-is-not-working
base: trunk
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+43
−7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… result in cache.
…the result in cache.
github-actions
bot
added
the
plugin: woocommerce
Issues related to the WooCommerce Core plugin.
label
Feb 15, 2023
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #36846 +/- ##
========================================
Coverage 46.7% 46.7%
- Complexity 17164 17170 +6
========================================
Files 429 429
Lines 64734 64759 +25
========================================
+ Hits 30203 30217 +14
- Misses 34531 34542 +11
|
Test Results SummaryCommit SHA: 4a624e2
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
mattyza
requested review from
a team and
psealock
and removed request for
a team
February 16, 2023 12:49
…conditional functions.
rcstr
approved these changes
Mar 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
psealock
requested review from
a team and
vedanshujain
and removed request for
a team
March 15, 2023 01:27
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Connected WooCommerce stores send requests to helper API for fetching details related to subscriptions and to get information about plugin updates. The responses from these API endpoints are cached to prevent stores from sending multiple requests frequently.
For example, the
GET subscriptions
request is cached for 1 hour andPOST update-check
request is cached for 12 hours.But for some stores, the cache can be completely broken due to DB having a full disk. This is because when
set_transient
is called if the object cache is not configured for the site wp options table will be used to store the transient value. (further discussions in this P2 post and the issue)Since the response from Helper API
GET subscriptions
andPOST update-check
is not the cached store will keep sending these requests. Basically this PR will block stores from calling above two endpoints if site local cache is not functioning.Find more details on this P2 post.
Closes # .
How to test the changes in this Pull Request:
wp cache flush
to remove any previously stored subscription response.wp-admin/admin.php?page=wc-addons§ion=helper
Could not find any subscriptions on your WooCommerce.com account
Update
button under My Subscriptions.wp wc com extension list
command should be blocked from making getting the subscription list.Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: