Skip to content

Podcast Player: keep rendering when the feed is slow or unreachable - #51212

Merged
arcangelini merged 13 commits into
trunkfrom
fix/podcast-latest-episodes-block
Aug 14, 2026
Merged

Podcast Player: keep rendering when the feed is slow or unreachable#51212
arcangelini merged 13 commits into
trunkfrom
fix/podcast-latest-episodes-block

Conversation

@arcangelini

@arcangelini arcangelini commented Aug 12, 2026

Copy link
Copy Markdown
Member

Proposed changes

Podcast feeds go down sometimes. When that happened, the Podcast Player block showed nothing at all — even if the same feed had loaded fine minutes earlier.

  • We now save the last episode list that loaded successfully and keep it for a week. If the feed stops answering, the block shows that saved copy instead of breaking.
  • If the feed answers fine but really has no episodes, we believe it and show the error. Old episodes don't come back from the dead.
  • While a feed is down we remember that for 90 seconds, so visitors don't all sit waiting on the same dead request.
  • The editor always sees the real error, so a bad feed URL still gets reported to the author instead of being hidden behind old episodes.

Does this pull request change what data or activity we track or use?

No. Feed responses were already cached; this keeps one extra copy of the same data as a fallback.

Testing instructions

  • Add a Podcast Player block to a post using a real feed URL, publish, and view the post on the front end. Episodes should render.
  • Make the feed unreachable — block the podcast host in your hosts file or firewall.
  • Clear the feed's cache so the block has to refetch: wp transient delete --all.
  • Reload the post on the front end. The episodes should still render. On trunk the block renders empty here.
  • Open the post in the editor. The real error should still appear, so a broken URL is still reportable to the author.
  • Unblock the host, clear transients again, and reload. The block should pick the live feed back up.

@arcangelini arcangelini self-assigned this Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/podcast-latest-episodes-block branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/podcast-latest-episodes-block

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Podcast [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests labels Aug 12, 2026
@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: September 7, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Aug 12, 2026
@jp-launch-control

jp-launch-control Bot commented Aug 12, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/_inc/lib/class-jetpack-podcast-helper.php 15/262 (5.73%) -0.74% 30 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@arcangelini arcangelini changed the title Podcast Player: read local feeds from the database Podcast Player: cache feed failures briefly Aug 12, 2026
@arcangelini arcangelini changed the title Podcast Player: cache feed failures briefly Podcast Player: keep rendering when the feed is slow or unreachable Aug 12, 2026
Cache the error itself, never the fallback, so the editor still refetches.
Treat an empty feed as authoritative rather than serving stale episodes.
Only remember a failure when stale episodes exist to cover it, so a cold start
retries instead of sitting empty. Drop the stored episodes when the feed reports
itself empty, and move the error window off the five-minute edge cache TTL.
Let the editor's endpoint ask for errors directly, so other REST renderers still
get the fallback. Keep stored episodes when a feed reports itself empty, and add
a filter to tune or disable the fallback.
Remember failures when the fallback is switched off, so disabling stale output
doesn't also disable negative caching. Seed the fallback from a cache entry that
predates it, so an upgrade doesn't leave feeds uncovered until they next refresh.
Nothing asked for it, and the only behaviour it bought was an empty block during
outages instead of stale episodes, since errors already render blank for anyone
without edit_posts.
@arcangelini
arcangelini requested a review from a team August 13, 2026 15:42
@arcangelini
arcangelini marked this pull request as ready for review August 13, 2026 16:04
@arcangelini
arcangelini merged commit b1ec494 into trunk Aug 14, 2026
79 of 80 checks passed
@arcangelini
arcangelini deleted the fix/podcast-latest-episodes-block branch August 14, 2026 06:55
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Aug 14, 2026
@github-actions github-actions Bot added the [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. label Aug 14, 2026
@github-actions github-actions Bot added this to the jetpack/16.2 milestone Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Podcast [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant