Skip to content

fix(rss): detect empty or HTML responses that feedparser treats as non-bozo #36

Description

@2233admin

Problem

The W1 schema-drift wiring in #35 handles RSS parse failures when feedparser reports bozo=True. A different blind spot remains: HTTP 200 responses containing an HTML error page or an empty body can be parsed as bozo=False with entries=[].

Those responses currently look like a successful empty feed, so no structured error_type reaches the control recorder and the SCHEMA_DRIFT sensor does not fire.

Reproduction

Observed with feedparser using both:

  • an HTML error page body
  • an empty response body

In both cases the result can be bozo=False and entries=[].

Expected behavior

Classify suspicious empty/non-feed responses explicitly without treating legitimate empty feeds as schema drift.

Acceptance criteria

  • define a conservative distinction between a valid empty feed and a non-feed/empty HTTP response
  • return a structured error type for the suspicious cases
  • ensure that error type maps to the intended control error kind
  • add unit tests for HTML error pages, empty bodies, and a valid feed with zero entries
  • document any content-type or body-shape heuristics used

Scope note

Keep this separate from #35. That PR repairs error propagation for known parser failures; this issue covers response-quality detection before/around parser classification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageMaintainer needs to evaluate this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions