Skip to content

[PR] fix(web): preserve the complete blog feed on manifest read failures - #7375

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-20_preserve-blog-manifest-on-errors
Nov 20, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-20_preserve-blog-manifest-on-errors

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

A failed read of the optional article manifest was caught together with the normal missing/malformed cases. A refresh could therefore publish its newly downloaded posts while discarding the previous article set and reporting success, even though the manifest's sources were temporarily unavailable.

Changes

Distinguish confirmed HTTP 404 misses from failed downloads throughout the text fallback chain. A hard failure on either attempted source remains a failure if no source succeeds; a later 404 cannot hide it.

Read the manifest separately from parsing its JSON. Download failures now reach the existing whole-round failure handler, which keeps the complete last-good overlay and sets the offline marker. Confirmed absence and a completely downloaded but malformed manifest retain the existing posts-only behavior. Successful source fallback and later refresh recovery continue to work.

Verification

  • Tested base: 1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3 (current master, 0.1.216).
  • Unchanged production: 5 behavior regressions fail, 27 controls pass. HTTP failures, network failures, unreadable bodies and both orderings of a mixed 404/hard failure remove the last-good article.
  • Corrected production: 51 targeted tests pass across web-blog-refresh, web-blogfeed and web-blog-route. Regressions also keep the old post rather than publishing a partial replacement and verify that a complete later refresh clears the offline marker.
  • Both changed files merge cleanly with pending [PR] fix(web): enforce decoded blog download byte limits #7341 at dcf235a21c82390e3970eb899213b5556b6ec0df; the combined targeted suites pass 62 tests. That PR handles byte-bounded reads; this change handles manifest transaction failures.
  • npm run typecheck, npm run build, npm run check:unused-exports, npm run check:test-import-graph and git diff --check: passed.
  • Published tree f611aa7fd85b54941267c741e5302edbfb3df5ba matches the locally validated tree.
  • Node 24.22.3 / Linux x86_64. Deterministic response fixtures exercise the production refresh and feed paths; no live GitHub outage or Windows run is claimed. Full regression evidence remains repository CI on this head.

Related #4917 and #5394. No new configuration or model-facing text.

Fixes #7374

@ranxianglei ranxianglei changed the title fix(web): preserve the complete blog feed on manifest read failures [PR] fix(web): preserve the complete blog feed on manifest read failures Nov 20, 2026
@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Duplicate screening: not a duplicate — searched open+closed issues/PRs for the blog-manifest / articles.json read-failure domain. #7375 is the only open PR fixing manifest read failures being classified as absence. #7341 (same author) is complementary, not parallel (byte-bounded reads vs manifest transaction failures); I verified the two merge cleanly. #5070 touches articles.json but is a different topic (dangling bundle entry).

Labels: source issue #7374 → bug, p2, scope/ui (matches its own triage note and the repo scale); this thread → bug, p2, scope/ui (web-panel defect, cross-client so no host-lane label).

Review of PR #7375 (fixes #7374)

Live state verified: head 265fd185 sits on current master 1e357bf2 (no rebase needed). CI on the pushed head: 84 check runs — 57 success, 27 skipped, 0 failed.

Verified locally (targeted runs only, per local-test discipline):

  • 51/51 targeted tests pass on the PR head across web-blog-refresh, web-blogfeed, web-blog-route — matches the claim.
  • Repro claim reproduced exactly: the new tests applied to the UNMODIFIED base fail 5/5 (the new regression tests) with 27 controls passing, and the failing assertion is precisely the defect (the previously-available article vanishes from getBlogFeed() after a partial refresh). The tests have teeth.
  • Merge with pending [PR] fix(web): enforce decoded blog download byte limits #7341 (dcf235a2): clean, no conflicts; combined targeted suites pass 62/62 — matches the claim.
  • npm run typecheck, npm run build, check:unused-exports, check:test-import-graph, git diff --check: all clean on the head.

Code review (main gate):

  • The fix is at the right layer — root cause, not a mask. The producer of the defect was runRound's manifest section catching confirmed absence and transport failure in ONE catch. The PR distinguishes the two at the transport boundary (fetchPlainText/fetchApiText throw a new TextFileNotFound only on confirmed HTTP 404), carries it through getTextChain (exhausted chain throws the last hard error if any occurred, a confirmed absence only when every attempt was a 404 — order-independent), and lets the one call site where absence is legal (the manifest) catch only TextFileNotFound. Hard errors now reach the existing whole-round failure handler, which I confirmed in src/web/blogfeed.ts:417 keeps the last-good overlay and sets the offline marker.
  • It aligns with the file's existing discipline: getImageChain already separates clean misses from hard errors; the text chain now gets the same treatment.
  • Regression inventory (existing behaviors on the touched paths):
    1. Manifest confirmed absent (both sources 404) → posts-only round: preserved.
    2. Manifest fully downloaded but malformed JSON → posts-only round: preserved (pinned by the pre-existing test at tests/web-blog-refresh.test.ts:453).
    3. Manifest transport failure (5xx / network / unreadable body / oversize) → was: publish posts-only, discard the previous article set, report success (the bug); now: whole-round failure, last-good overlay kept, offline marker set: the intended change, disclosed in the PR body.
    4. Post / article-file 404 or hard failure → whole-round failure: unchanged (TextFileNotFound still propagates on those paths — there is no catch there).
    5. Image chain, chain.start walk-point advancement, post listing (getJsonList): untouched.
  • Tests: 5 parameterized failure modes (http / network / raw-404+api-hard / raw-hard+api-404 / unreadable body) cover both mixed orderings; they assert on real getBlogFeed() output (article kept with old html, old post body kept, partial new post NOT published, error === "offline"), plus a recovery round asserting the marker clears. True behavior tests, both gate directions asserted.
  • No config surface, no model-facing text, no kernel/wire/persistence changes.

One non-blocking observation: the new hadHardError boolean is redundant with lastHardError !== undefined (which getImageChain uses) — a stylistic preference, not a defect; not requesting a change.

§7.4 auto-merge gate: all conditions met — single-module fix:, regression test reproducing the original bug, green on the rebased head (CI 0 failed), no config/persistence/wire/kernel changes, clean diff, Fixes #7374, no load-bearing infra touched.


结构化八问(中文):

  1. 是什么问题:博客每小时刷新时,文章清单 articles.json 的「下载失败」被当成「清单不存在」处理——帖子下载成功但清单源临时不可用时,刷新会发布一个只有帖子的新 overlay,把上一轮完整 overlay 里的文章全部丢掉,还报告成功、没有 offline 标记。
  2. 什么原因导致的:runRound 的 manifest 段用一个 catch 同时兜了「确认缺失(404)」和「传输失败(5xx/网络/坏 body)」两类本质不同的失败,传输失败因此走了 posts-only 降级路径而不是整轮失败路径。
  3. 影响范围与严重程度:所有跑 web 面板的实例,在刷新窗口内 GitHub 两个一手源(raw + contents API)同时出现非 404 故障时触发;触发时已发布文章从面板消失(帖子仍在)、无离线提示。特定条件下有问题(需 manifest 源临时故障),不毁可用性 → p2。
  4. 怎么修复的:在传输边界区分两类失败——404 抛新的 TextFileNotFound(确认缺失),其余保持硬错误;getTextChain 全链耗尽时「有硬错抛硬错、全 404 才抛缺失」(与顺序无关);manifest 段只捕获确认缺失(保持 posts-only),硬错误上抛到既有整轮失败处理器(保留最后完整 overlay + offline 标记)。与同文件 getImageChain 既有的 clean-miss/hard-error 纪律对齐。
  5. 是否有回归问题:无无意回归。既有行为逐项:①清单确认缺失(双 404)→ posts-only:保持;②清单下载完整但 JSON 坏 → posts-only:保持(既有测试钉住);③清单传输失败 → 由「发布 posts-only 并丢文章」变为「整轮失败、保留最后完整 overlay + offline 标记」:有意变更,PR 正文已披露;④帖子/文章文件 404 或硬失败 → 整轮失败:不变(新错误类在这些路径无 catch,照常上抛);⑤图片链 / chain 推进 / 帖子列表:未触碰。
  6. 是否破坏缓存:不涉及(无缓存/重试/游标/去重键变化;chain 状态推进逻辑未动)。
  7. 是否改了设计方向:不涉及(沿用既有「整轮原子替换 + 失败保最后完整 overlay」设计,只是把 manifest 传输失败归入既有的整轮失败类)。
  8. 是否引入了新的配置:不涉及(无新 env/config/默认值;无模型可见文本变化)。

判定:可合并 —— CI 全绿(84 项 0 失败)+ 本地定向验证全过(含 base 复现 5/5 失败、#7341 合并 62/62)+ 回归清点无意外 + 满足 §7.4 自动合并门禁全部条件。合并动作按仓库规则由人执行。

@ranxianglei ranxianglei added bug Something isn't working p2 scope/ui labels Nov 20, 2026
@ranxianglei
ranxianglei merged commit dd59c3d into ranxianglei:master Nov 20, 2026
120 of 156 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working p2 root-cause scope/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Temporary article-manifest failures discard the last complete blog feed

2 participants