Skip to content

Fix sitemap parsing (ENG-3361) - #2085

Merged
mogery merged 5 commits into
mainfrom
tom/eng-3361-map-is-only-returning-around-200-results
Sep 2, 2025
Merged

mogery merged 5 commits into
mainfrom
tom/eng-3361-map-is-only-returning-around-200-results

Conversation

@amplitudesxd

@amplitudesxd amplitudesxd commented Sep 1, 2025

Copy link
Copy Markdown
Member

Summary by cubic

Fix sitemap discovery and robots.txt handling so /map returns the full set of site URLs instead of stalling around ~200 (ENG-3361). We now parse sitemaps from robots.txt and the root, respect robots rules, and feed those URLs into map results with caching.

  • Bug Fixes

    • Discover and parse sitemaps from robots.txt and /sitemap.xml, add URLs to map results, and cache sitemap responses for 48h when called from /map.
    • Apply robots.txt allow/deny consistently (including trailing-slash cases) and honor crawl-delay; allow opt-out via ignoreRobotsTxt.
    • Filter strictly by domain and the requested path (when not mapping the root); drop external, social, and anchor-only links; improve backward-crawling checks and URL normalization.
    • Add a robots.txt parser test to verify directives, allow/deny, and sitemap URLs.
  • Refactors

    • Replace axios with undici and a shared secure dispatcher across robots, scraping, file downloads, and webhooks; proper TLS-skip support.
    • Improve charset decoding and error handling in fetch paths; minor logging cleanups.
    • Batch webhook log inserts and send webhooks via the shared dispatcher.

@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.

6 issues found across 8 files

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

Comment thread apps/api/src/lib/robots-txt.ts Outdated
Comment thread apps/api/src/__tests__/snips/v2/robots-txt.test.ts Outdated
Comment thread apps/api/src/__tests__/snips/v2/robots-txt.test.ts
Comment thread apps/api/src/__tests__/snips/v2/robots-txt.test.ts
Comment thread apps/api/src/__tests__/snips/v2/robots-txt.test.ts Outdated
Comment thread apps/api/src/scraper/WebScraper/crawler.ts
Comment on lines +2 to +12
import { scrapeTimeout, idmux, Identity } from "./lib";

let identity: Identity;

beforeAll(async () => {
identity = await idmux({
name: "robots-txt",
concurrency: 100,
credits: 1000000,
});
}, 10000);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove the idmux call -- since you don't call the API here, you don't need an Identity

@mogery
mogery merged commit 688bf93 into main Sep 2, 2025
9 of 10 checks passed
@mogery
mogery deleted the tom/eng-3361-map-is-only-returning-around-200-results branch September 2, 2025 12:47
jerbao pushed a commit to jerbao/firecrawl-custom that referenced this pull request Aug 22, 2026
Co-authored-by: Gergő Móricz <mo.geryy@gmail.com>
zeekay pushed a commit to Dream-AI-4444/firecrawl that referenced this pull request Sep 10, 2026
Co-authored-by: Gergő Móricz <mo.geryy@gmail.com>
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