You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(rss): detect empty or HTML responses that feedparser treats as non-bozo #36
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.
Activity
1012839419a-alt commentedon Aug 7, 2026
复核(2026-08-08):仍待修复
对照
origin/main(7838811)检查:backend/channels/rss_channel.py目前只有_bozo_error_type()(处理 feedparser 标记 bozo 的情况,W1 相关,已修),没有针对空响应 / HTML 响应(feedparser 当作非 bozo 有效解析)的显式检测逻辑——grep 无empty/text/html/non-bozo相关分支。本 issue 描述的 bug 场景(空或 HTML 响应被当作有效 feed 解析出 0 条或垃圾条目)与 W1 是两回事,仍 open。修复方向:在
collect()/parse 后校验entries为空且bozo为 False 时,或content-type含text/html时,显式标记为失败(error_type 建议沿用ParseError以落入 SCHEMA_DRIFT 分类)。1012839419a-alt commentedon Aug 7, 2026
修复完成(2026-08-08)
已提交 PR #69(
fix(rss): detect empty or HTML responses feedparser treats as non-bozo),关闭本 issue。核实结论
origin/main确实未修复:rss_channel.py仅有 W1 的_bozo_error_type()(bozo=True 分支),无空/HTML 响应的显式检测。复现(feedparser 6.0.12 实测)
bozo=False, entries=0, version=Nonebozo=False, entries=0, version=''bozo=False, entries=0, version='rss20'/'atom10'修复方案(保守区分)
在
collect()与fetch()的 bozo 分支之后增加检测:零条目且 feedparser 未识别任何 feed 格式(version 为空) → 显式失败,error_type="ParseError"(error_kinds.py已映射 SCHEMA_DRIFT)。判据是 feedparser 的version字段(body-shape 启发式,已写入 docstring)。合法空 feed 因 version 非空不受影响;部分解析出条目的 feed 不受影响。验证
pytest tests/unit/channels/ tests/unit/test_workflow_rss_source_executor.py:285 passedruff check:通过fix(rss): detect empty or HTML responses feedparser treats as non-bozo (