Skip to content

Check the image captcha type before the requested dataset - #3607

Merged
forgetso merged 1 commit into
mainfrom
fix/image-type-check-before-dataset
Oct 24, 2026
Merged

forgetso merged 1 commit into
mainfrom
fix/image-type-check-before-dataset

Conversation

@forgetso

Copy link
Copy Markdown
Member

What changed
When someone asks the provider for an image challenge, it now checks "does this site key serve image captchas?" before "does the dataset you named exist?". #3409 (in 3.9.1) put the dataset check first.

Effect

  • The answer people get: a site key that serves PoW, puzzle or frictionless now gets INCORRECT_CAPTCHA_TYPE again, whatever datasetId it sends. Since 3.9.1 it got "Unknown dataset" (INVALID_REQUEST:PROV-94).
  • Why it matters: the demo monitor relies on that answer to work out which captcha type each demo key serves. Since the 3.9.1 deploy (2026-10-23 11:24 UTC) it has reported every demo as broken. The demos themselves are fine; real visitors have completed PoW, puzzle and image challenges throughout.
  • Image keys are unaffected: a key that does serve image still gets the same 400 for an unknown dataset.

Tests

  • New test in imageChallengeClientDatasetId.unit.test.ts: a wrong-type key that sends an unknown datasetId gets INCORRECT_CAPTCHA_TYPE, and the dataset is never looked up. It fails without this change.
  • Existing tests: the six dataset tests still pass (7/7). Their stubs gained imgCaptchaManager, because the handler now gets to the type check before the dataset check.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@forgetso
forgetso enabled auto-merge (squash) October 24, 2026 08:00
@forgetso
forgetso merged commit 870fab7 into main Oct 24, 2026
18 checks passed
@forgetso
forgetso deleted the fix/image-type-check-before-dataset branch October 24, 2026 08:14
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