Skip to content

fix(api/scrape): document + pdf scrape loop - #2396

Merged
amplitudesxd merged 1 commit into
mainfrom
dl3/fix/document-pdf-scrape-loop
Nov 13, 2025
Merged

amplitudesxd merged 1 commit into
mainfrom
dl3/fix/document-pdf-scrape-loop

Conversation

@delong3

@delong3 delong3 commented Nov 13, 2025

Copy link
Copy Markdown
Collaborator

Summary by cubic

Fixes the scrape loop for document and PDF by capping anti-bot retries to a single reattempt, then skipping to prevent endless loops. Improves scraper stability and reduces noisy logs.

  • Bug Fixes
    • Added documentReattempted and pdfReattempted flags to limit retries to one.
    • On first block, remove the "document" or "pdf" feature flag to prefetch via chrome-cdp; on subsequent block, log and skip.
    • Keeps other error handling intact and respects existing forceEngine behavior.

Written for commit 6fee5be. Summary will update automatically on new commits.

@delong3
delong3 requested a review from mogery as a code owner November 13, 2025 07:08

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="apps/api/src/scraper/scrapeURL/index.ts">

<violation number="1" location="apps/api/src/scraper/scrapeURL/index.ts:1031">
After the document antibot fallback has already been attempted, this branch just logs and continues, leaving the surrounding while(true) loop to hit DocumentAntibotError again with unchanged state. Throw the error after logging so the loop exits instead of spinning.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

Comment thread apps/api/src/scraper/scrapeURL/index.ts
@amplitudesxd
amplitudesxd merged commit 92ed497 into main Nov 13, 2025
6 of 8 checks passed
jerbao pushed a commit to jerbao/firecrawl-custom that referenced this pull request Aug 22, 2026
zeekay pushed a commit to Dream-AI-4444/firecrawl that referenced this pull request Sep 10, 2026
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.

2 participants