Skip to content

fix(scraper): bound optional discovery to one deadline - #3

Merged
agalwood merged 1 commit into
mainfrom
fix/2151_scraper_budget_20260917
Sep 17, 2026
Merged

agalwood merged 1 commit into
mainfrom
fix/2151_scraper_budget_20260917

Conversation

@agalwood

@agalwood agalwood commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Optional scraper discovery could spend separate five- and ten-second budgets on HEAD and GET, delaying task creation. This change shares one three-second deadline, forwards the task's request headers, and keeps the original URL when optional network discovery fails.

  • Skip GET if HEAD has exhausted the budget; retain the existing response-size cap.
  • Propagate cancellation, permission, and unexpected failures instead of silently swallowing them.
  • Keep source URLs and arbitrary error text out of scraper logs.
  • Add regression coverage for the shared budget and failure classification.

Validation: pnpm test (60 passed), pnpm run lint, pnpm run typecheck, and pnpm run build all passed.

Related: agalwood/Motrix#2151. Companion host-side URL admission and invocation cancellation PR: agalwood/Motrix#2154. This PR does not publish a signed plugin release or update the application's builtins lock.

Share a three-second budget between HEAD and GET, forward download headers, and retain the original source for optional network failures. Propagate permission and cancellation failures, and keep source URLs out of diagnostics.
@agalwood
agalwood merged commit b57f909 into main Sep 17, 2026
1 check passed
agalwood added a commit that referenced this pull request Sep 23, 2026
The hook ran in the pre-resolve band, which fails its chain closed. With
`*://*/*` host permissions, any failure or slow page aborted the creation
of every HTTP task (agalwood/Motrix#2189). Looking up a direct link on an
HTML page is an optional convenience and must never veto a download.

Run beforeCreate in the enrich band. There a failure or overrun drops the
plugin's contribution and Motrix downloads the URL the user gave.
pre-resolve is also reserved for builtin origin, and Motrix is retiring
the plugin from its bundled set, so the plugin could not load there
without this change.

Bump to 1.1.0, which also ships the single three-second discovery
deadline merged in #3. Document the move in the READMEs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant