Skip to content

Skip malformed podcast episode download URLs - #5540

Open
harlanluo wants to merge 1 commit into
advplyr:masterfrom
harlanluo:fix/4847-malformed-podcast-url
Open

harlanluo wants to merge 1 commit into
advplyr:masterfrom
harlanluo:fix/4847-malformed-podcast-url

Conversation

@harlanluo

Copy link
Copy Markdown

Brief summary

Skip podcast episodes with malformed enclosure URLs instead of allowing URL normalization to reject the complete episode-download operation. Valid episodes that follow are still processed.

Which issue is fixed?

Fixes #4847

In-depth Description

PodcastEpisodeDownload.setData() validates and normalizes enclosure URLs using decodeURIComponent() and encodeURI(). Certain malformed percent-encoded URLs cause decodeURIComponent() to throw a URIError.

Previously, this error escaped from PodcastManager.downloadPodcastEpisodes(), rejecting the manager promise and preventing later episodes in the same batch from being processed.

The manager now catches only URIError while preparing each episode, logs the affected episode, and continues with the remaining episodes. Unexpected non-URIError failures are still rethrown normally.

Regression tests cover malformed percent-encoded URLs, valid URL normalization, unexpected error propagation, and continuation to a valid episode after a malformed one.

How have you tested this?

  • Reproduced URIError: URI malformed using an enclosure URL matching the malformed percent-encoding pattern from issue [Bug]: Bad URL when downloading podcast causes server crash #4847.
  • Confirmed the previous unguarded manager path produced a rejected promise.
  • Confirmed the fixed manager path skips the malformed episode and completes normally.
  • Confirmed a valid episode following the malformed episode is still processed.
  • Ran focused tests: 13 passing, 0 failing.
  • Ran the full server test suite: 367 passing, 0 failing.
  • Ran git diff --check: passed.

Screenshots

Not applicable — this is a server-side change with no user-interface changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bad URL when downloading podcast causes server crash

1 participant