Skip to content

Conversation

bjtitus
Copy link
Contributor

@bjtitus bjtitus commented Jul 9, 2025

Fixes PCIOS-11

  • Adds a retryWithoutUserAgent Feature Flag
  • Retries failed HTTP requests with a status code between 400 and 599 without the User Agent header

This is analogous to the Android change in Automattic/pocket-casts-android#3180

To test

  • Attempt to play a podcast episode from El sótano
  • ✅ Verify that the episode plays
  • ✅ Verify that you see the following logs:
MediaExporterResourceLoaderDelegate: Retrying without User-Agent header for URL: https://ztnr.rtve.es/ztnr/16654690.mp3
MediaExporterResourceLoaderDelegate: Starting request without User-Agent header
  • Attempt to download a podcast episode from El sótano
  • Verify that the episode downloads
  • ✅ Verify that you see the following logs (note the "Downloading episode ... without User-Agent"):
DownloadManager: Retrying download without User-Agent for episode: a2ff4eb5-f94d-4ad7-a700-ceb1339be534, status code: 403
DownloadManager: Retrying download without User-Agent for episode: a2ff4eb5-f94d-4ad7-a700-ceb1339be534 at URL: https://ztnr.rtve.es/ztnr/16652428.mp3
Downloading episode El sótano - Las valijas de New Rose Records (IV) - 04/07/25, autoDownloadStatus: notSpecified, previousDownloadFailed: true, without User-Agent

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@dangermattic
Copy link
Collaborator

dangermattic commented Jul 9, 2025

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

This is enabled by default
@bjtitus bjtitus changed the title Retry without user agent Retry failed requests without user agent Jul 10, 2025
@bjtitus bjtitus force-pushed the bjtitus/retry-without-user-agent branch from ef454f2 to b8c527e Compare July 10, 2025 01:17
@bjtitus bjtitus force-pushed the bjtitus/retry-without-user-agent branch from b8c527e to fcc73cd Compare July 10, 2025 01:32
@bjtitus bjtitus marked this pull request as ready for review July 10, 2025 01:33
@bjtitus bjtitus requested a review from a team as a code owner July 10, 2025 01:33
@bjtitus bjtitus requested review from danielebogo and removed request for a team July 10, 2025 01:33
@bjtitus bjtitus force-pushed the bjtitus/retry-without-user-agent branch from fcc73cd to 1448133 Compare July 10, 2025 02:42
@danielebogo danielebogo added this to the 7.94 milestone Jul 10, 2025
@danielebogo danielebogo added the [Type] Bug Used for issues where something is not functioning as intended. label Jul 10, 2025
Copy link
Contributor

@danielebogo danielebogo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working correctly :shipit:

@bjtitus bjtitus merged commit bd8465a into trunk Jul 11, 2025
7 of 9 checks passed
@bjtitus bjtitus deleted the bjtitus/retry-without-user-agent branch July 11, 2025 01:47
Copy link

sentry-io bot commented Jul 13, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Used for issues where something is not functioning as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants