Repository navigation
Add ReadConfig with an option to skip invalid entries - #102
Open
emschwartz wants to merge 1 commit into
Open
emschwartz wants to merge 1 commit into
emschwartz wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #102 +/- ##
==========================================
+ Coverage 83.85% 84.68% +0.82%
==========================================
Files 14 14
Lines 1016 1038 +22
==========================================
+ Hits 852 879 +27
+ Misses 164 159 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
andy128k
reviewed
Nov 17, 2026
One entry with an unparseable date or an unknown text type made Feed::read_from fail, losing every other entry in the feed. With ReadConfig::skip_invalid_entries set, Feed::read_with_config leaves such an entry out and keeps reading. The default stays strict so the crate can still be used to validate feeds, and malformed XML is still an error. andy128k suggested skipping invalid entries in rust-syndication#100 (comment), following their earlier proposal in rust-syndication/rss#69 to keep the rest of a feed when one item is broken. That proposal was about malformed XML; this only covers entries with invalid values. Review fix from andy128k: ReadConfig no longer derives Copy, so non-Copy options can be added later without a breaking change (rust-syndication#102 (comment)). Refs rust-syndication#100 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emschwartz
force-pushed
the
skip-invalid-entries
branch
from
November 17, 2026 21:23
3b1afa5 to
274239c
Compare
This file contains hidden or 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
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.
Refs #100. Adds the per-entry skipping @andy128k suggested in #100 (comment), following the idea from their rust-syndication/rss#69: keep the rest of the feed when one item is broken. Unlike rss#69, which was about malformed XML, this only skips entries with invalid values; malformed XML stays fatal.
The default stays strict, so validators built on the crate still see the error. Only
WrongDatetimeandWrongAttributeare skipped; malformed XML still fails the feed. After a failed entry the reader skips to its matching</entry>with the sameskiphelper used elsewhere, which works wherever inside the entry the error came from (e.g. a bad date in<source>).ReadConfigis#[non_exhaustive], unlikeWriteConfig, so the relaxed-validation option from the issue (treat a bad date as missing) can be added later as a second field without a breaking change. That option is left out of this PR.#100 is assigned to @DCjanus; if there is already work in progress there, feel free to close this.
Authored by Claude (claude-opus-5-5)