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
[PR] fix(web): preserve the complete blog feed on manifest read failures - #7375
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.
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.
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
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).
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.
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):
Manifest fully downloaded but malformed JSON → posts-only round: preserved (pinned by the pre-existing test at tests/web-blog-refresh.test.ts:453).
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.
Post / article-file 404 or hard failure → whole-round failure: unchanged (TextFileNotFound still propagates on those paths — there is no catch there).
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.
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
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.
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
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3(currentmaster, 0.1.216).web-blog-refresh,web-blogfeedandweb-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.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-graphandgit diff --check: passed.f611aa7fd85b54941267c741e5302edbfb3df5bamatches the locally validated tree.Related #4917 and #5394. No new configuration or model-facing text.
Fixes #7374