Skip to content

fix(report): a captcha-blocked widget reports to nobody #387

Closed

Description

@sydevs-bot

Summary

When the captcha gate refuses a host page the whole widget fails, and nothing records it. REPORTED_KINDS['captcha-blocked'] is false, so no Sentry event is ever sent, and the only signal is a console line on the host's own page. Since 3 November that gate is live and keyed to an allowlist of host domains, which makes this the widget's most likely production failure and the one failure we cannot observe.

Approach

1. The defect

  • src/hooks/use-turnstile-guard.ts:79 throws atlasError('captcha-blocked', …) during render. ResetErrorBoundary catches it, and the visitor gets error.captcha_blocked in place of the atlas (src/components/molecules/Fallbacks/Fallbacks.tsx:257).
  • src/lib/report.ts:210 sets 'captcha-blocked': false, so captureError returns at :533 before the reporter is loaded.
  • The reason stated beside the flag does not hold for this path. It says the report POST is itself Turnstile-gated, which is true of the visitor-facing report form and false of captureError, which posts to the Sentry DSN over @sentry/browser's own fetch transport (:542). Nothing in that path touches the gate. The same wording is sound for offline, where there is no network to post over; it is not sound here.
  • config, the sibling kind for a host misconfiguration, is reported (:205).
  • Nothing else covers it. reportEmbed (src/config/api/mutate.ts:445) sends a mount fingerprint at boot, never a failure — and SahajCloud refuses that POST from a host outside the client's siteHosts, so the embeds we cannot hear from are exactly the embeds that are broken.

2. The fix

Report the kind, and correct the comment to a reason that is true.

Noise is the objection, and it is bounded already: dedupeIntegration is in the client (src/lib/report.ts, loadReporter), MAX_EVENTS_PER_PAGE caps a page load, and the transport latches off after one refusal. Tagging is unchanged — atlas.kind already carries the kind.

Weigh one alternative before writing code: SahajCloud's /api/atlas/challenge already answers 403 and already knows the parent host, so it could log every refusal with no client traffic at all. That is the cheaper census, and it is a different repo — see ## Notes. It does not replace this half: only the client knows a visitor actually saw the broken screen.

3. The spec that let it through

src/lib/report.sentry.test.ts:147 — the which failures are worth an event table lists five of the six kinds and omits captcha-blocked, the one whose value is contentious. Add it, and watch the row fail against the current false before counting it (docs/testing.md).

Acceptance criteria

  • A captcha-blocked failure produces one Sentry event, tagged atlas.kind: 'captcha-blocked'.
  • The comment beside REPORTED_KINDS['captcha-blocked'] states a reason that is true of captureError, or the entry carries no reason at all. It must not claim the Sentry channel is Turnstile-gated.
  • report.sentry.test.ts's table covers every ErrorKind, so a future change to any row is a spec change.
  • The visitor-facing screen is unchanged: ERROR_POLICY['captcha-blocked'] still offers no report action and still retries.

Verification checklist

  • pnpm test:run src/lib/report.sentry.test.ts passes, and the new row goes red when REPORTED_KINDS['captcha-blocked'] is set back to false.
  • pnpm test:run src/components/molecules/Fallbacks passes unchanged.
  • .claude/skills/pr-prep/check.sh passes.
  • pnpm build && pnpm size stays inside budget.

Notes

Found while verifying #259 on 2026-11-11, by measurement rather than by an error: SahajAtlasWeb's Sentry project carries zero unresolved issues in 14 days, which is what this seam produces whether the gate is healthy or not.

The full question is larger than this repo and may be roadmap-sized. Nothing anywhere notices that a site's map has stopped working: sydevs/SahajCloud#1106's audit sees only hosts that report, POST /api/clients/report refuses a host outside the client's siteHosts (SahajCloud/src/collections/Clients/endpoints/report.ts:148), and VerifyEmbeds skips any client without site.page, which #1106 found is all of them. This ticket is SahajAtlasWeb's half, and it stands on its own. Leaving the promotion to @sydevs-bot revise on a human's call.

#232 is prior art, and it recorded captcha-blocked as never-reported in passing without examining the reason — reasonably, since the parent gate did not exist then.

🤖 Written by the sydevs autonomous loop — see what this is

Activity

  1. added theissue type on Nov 11, 2026
  2. added
    proposal
    on Nov 11, 2026
  3. Ardnived commented on Nov 12, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  4. added
    bot:working
    and removed
    proposal
    on Nov 12, 2026
  5. sydevs-bot commented on Nov 12, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running
    approved by Ardnived

    recent dispatches
    • 03:56Z implement · attempt 1 · session · done
    • 03:56Z implement · attempt 1 · session

    Written by the sydevs dispatcher. Sessions never edit this comment.

  6. moved this from Awaiting to Working in SYDevelopers Technical Roadmapon Nov 12, 2026
  7. removed
    bot:working
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Medium

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions