Repository navigation
fix(beholder): ignore third-party network resets when scraping - #991
Merged
Merged
Conversation
Default page-level disconnection retries to same-host failures so blocked third-party hosts no longer discard reachable HTML. Callers can restore all-hosts strictness with networkDisconnectionScope: 'all'. Behavior change: Scraper retries on network disconnection only for same-host failed requests by default. Third-party ERR_CONNECTION_RESET (and similar) no longer fail the whole page; they remain in failedRequests. Pass networkDisconnectionScope: 'all' for the previous behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Fixes #989
Summary
Scraperのネットワーク切断リトライ判定を、既定でページ本体と同一ホストの失敗に限定ScraperOptions.networkDisconnectionScope: 'same-host' | 'all'を追加(省略時'same-host')failedRequestsに全件記録振る舞いの変更
not breaking— 到達できたページ本体の HTML/アンカーを捨てる挙動は feat(beholder): track requestfailed events and support page-level retry on network disconnection #864 の意図(一時的回線断)から外れた誤検知だった。意図された「同一ホストの一時切断でリトライする」使い方は維持され、旧の全ホスト厳格さは'all'で復元できる@d-zero/beholderのscrapeStart/#fetchData。切断系エラーでのページ失敗・リトライ条件net::ERR_CONNECTION_RESET等でページ全体が失敗(retries 尽きる)failedRequestsnetworkDisconnectionScope: 'all'を渡す。通常のクロール利用はオプション追加不要(既定で beholder: サードパーティの接続リセットでページ全体が取得失敗になる #989 が直る)対象外
https://example.com→https://www.example.com) setsisExternal = truein#fetchDataand returns beforefindDisconnectionFailures, so same-host network-disconnection retry never runs on the final host. Suspected cause: external early-return path inpackages/@d-zero/beholder/src/scraper.tsaround thedestUrl.hostname !== url.hostnamebranch. — Filed as beholder: クロスホスト redirect 後にネットワーク切断リトライが走らない #990意図的に変更しないもの
ScraperOptionsの JSDoc)NO_COLORによるremote-inspectorANSI テスト失敗(検証はFORCE_COLOR=1 yarn test)