Skip to content

Stop carrying the crawler's name in a field called is_crawler - #3621

Merged
forgetso merged 3 commits into
mainfrom
crawler/name-field
Oct 26, 2026
Merged

forgetso merged 3 commits into
mainfrom
crawler/name-field

Conversation

@forgetso

Copy link
Copy Markdown
Member

The problem

ipapi.is returns the crawler's name in a field called is_crawler — "BaiduSpider", "GoogleBot" — even though every consumer declares it a boolean. Measured on production over one hour: false on 29,869 sessions, then "BaiduSpider" 1,637, "FacebookBot" 35, "GoogleAdsBot" 8, "AhrefsBot" 6, "GoogleBot" 1.

So isCrawler === true is dead code, and two files in captcha-private carry long comments explaining the workaround.

What this changes

isCrawler is now an actual boolean. The name goes in crawlerName.

The two backends disagree on the wire and both are live: our reputation sidecar returns a real boolean is_crawler plus its own crawler field, while the vendor worker (still used by the job runner) sends the name through is_crawler. So IPApiResponse.is_crawler is typed boolean | string — describing what actually arrives rather than what we wish did — and a small crawlerName() helper reads whichever is present.

Nothing that makes a decision changes: every existing consumer treats isCrawler as truthy/falsy, and both a name string and true are truthy.

Tests

Five new cases: the vendor's name, the sidecar's field, a crawler with no name, a non-crawler, and an empty string. 34 passing in the package, type-check clean, biome clean.

Part of prosopo/captcha-private#5548.

🤖 Generated with Claude Code

The ipapi.is worker returned the crawler's NAME through `is_crawler` —
"BaiduSpider", "GoogleBot" — while every consumer typed it `boolean`.
Measured on production over an hour: `false` on 29,869 sessions, then
"BaiduSpider" 1,637, "FacebookBot" 35, "GoogleAdsBot" 8, "AhrefsBot" 6,
"GoogleBot" 1. So `ipInfo.isCrawler === true` matched nothing, and two
files in captcha-private carry long comments working around it.

The reputation sidecar that replaced it answers a real boolean plus a
separate `crawler` field, so `isCrawler` is now genuinely a boolean and
the name lives in `crawlerName`.

No accommodation for the old worker's shape: it is being retired, not
run alongside.

Part of prosopo/captcha-private#5548.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@forgetso
forgetso merged commit f79a406 into main Oct 26, 2026
20 checks passed
@forgetso
forgetso deleted the crawler/name-field branch October 26, 2026 21:26
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