My Jetpack: Improve product cache handling on Jetpack AI#34428
My Jetpack: Improve product cache handling on Jetpack AI#34428lhkowalski merged 7 commits intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. |
| * if the list is still empty after the fresh data, we will | ||
| * default to empty pricing (by returning an empty array). | ||
| */ | ||
| if ( empty( $product->price_tier_list ) && isset( $info['tier-plans-enabled'] ) && $info['tier-plans-enabled'] === true ) { |
There was a problem hiding this comment.
When disconnected, $product returns an error and this causes a fatal on My Jetpack. We'll need a check there for an error response.
dhasilva
left a comment
There was a problem hiding this comment.
LGTM. Looking smooth now! 🚀
* Only shows the price when the price information is available * Support cache busting from the get_product method * Renew product cache if tiers are enabled but there is no tier info on the cache * Add changelog file * Check for wp_error on feature data to handle Jetpack not being connected
|
Cherry picked to release branch in 1980da3 |
* Add changelogs * Changelog edits. * Amend readme.txt * Updated package versions for automattic/jetpack * Updated package versions for automattic/jetpack-mu-wpcom-plugin * My Jetpack: Improve product cache handling on Jetpack AI (#34428) * Only shows the price when the price information is available * Support cache busting from the get_product method * Renew product cache if tiers are enabled but there is no tier info on the cache * Add changelog file * Check for wp_error on feature data to handle Jetpack not being connected * Release my-jetpack * Update my-jetpack dependency * Update changelog and readme.txt for Jetpack 12.9 * Carousel: fix unresponsive navigation (#34678) * Changelog adn readme for 12.9.1 * Bump version numbers to 12.9.1 * Fix token subscription service name (#34723) * Rename Token_Subscript_Service to Abstract_Token_Subscription_Service * changelog * Allow old class just in case * `use` classes at the top to shorten up the class check. * Release Videopress 0.21.3.1 --------- Co-authored-by: Kuba Birecki <kuba.birecki@crystalplanet.io> Co-authored-by: Luiz Kowalski <lhkowalski@gmail.com> Co-authored-by: sdixon194 <steve.dixon@automattic.com> Co-authored-by: Kev <kevin.zoschke@automattic.com> Co-authored-by: Christopher Smith <8002138+chrisfromthelc@users.noreply.github.com>
Fixes #34347.
Proposed changes:
price_tier_listis empty (meaning that the site does not have tier prices yet, meaning it needs a fresh product information)Wpcom_Products::get_product()functionOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Fill the cache with production product data (no tiers)
Jetpack > My Jetpack, scroll to the Jetpack AI card and click the purchase buttonTesting with the tiers
HTTP API Callssection and confirm a request was made tohttps://public-api.wordpress.com/rest/v1.1/sites/BLOG_ID/products/, to refresh the cache:Jetpack > My Jetpack, scroll the page to the Jetpack AI card, clickPurchase)