Skip to content

fix(report): nothing has ever reached the widget's Sentry project #232

Closed

Description

@sydevs-bot

Summary

The sahajatlas-web Sentry project has received zero events, all time — seven weeks after #108
(closed by #123) wired reportInternalError to it. The widget runs inside other people's pages,
where we have no logs of any kind, so Sentry is our only production signal, and it is silent.

Nothing in the code is broken. reportingDsn() (src/lib/report.ts:254-258) returns null when
VITE_SENTRY_DSN is empty and the SDK is then never fetched — exactly as designed.
The production deploy confirms it: VITE_SENTRY_DSN is unset on the sahajatlas Pages
Production environment, so the seam #123 built has never been live.

Evidence

Unbounded and 14-day windows both return nothing:

curl -s "https://de.sentry.io/api/0/projects/sy-developers/sahajatlas-web/issues/?query=&statsPeriod=" \
  -H "Authorization: Bearer $SENTRY_CLAUDE_WORKFLOW_TOKEN" | jq length
# → 0

The same call returns 37 for sahajcloud and 1 for wemeditate-web, so the token, the region
host and the project slug are all fine.

The deployed production bundle names no ingest host. Read back on 2026-09-29 from
https://sahajatlas.pages.dev, the standalone eager graph (six /assets/*.js files) plus
embed.js, auto.js and assets/element-*.js contain no ingest substring and no
https://…sentry… literal. The same fetch finds https://cloud.sydevelopers.com/api, so the read
is not vacuous, and it finds report.ts's own literals (Refusing to link to, captcha-blocked),
so the seam ships — only the DSN is missing. This settles the diagnosis without opening a
dashboard.

Reporting is wired at ten call sites (src/App.tsx:101 and :265, src/Widget.tsx:152,
src/config/locale.ts:96, src/components/molecules/Fallbacks/Fallbacks.tsx:1004 and :1063,
src/components/atoms/Link/Link.tsx:111, src/components/atoms/Button/Button.tsx:219,
src/components/molecules/ActionRow/ActionRow.tsx:124,
src/hooks/use-recovery-offer.ts:117), plus reportIntegrationWarning. A failed locale fetch or
any render crash on any host site would report. None has.

Approach

VITE_SENTRY_DSN is build-time — Vite inlines it — so it has to exist in the Cloudflare Pages
dashboard before a build. A run cannot set it: this repo holds no Cloudflare credentials.
Phase 1 is therefore a human dashboard action, and it must land before Phase 2 merges, or the
new assertion is a red gate on every PR.

Phase 1 — provision (dashboard, human)

  1. Set VITE_SENTRY_DSN on the sahajatlas Pages Production environment, in the modern
    public-key form https://<key>@o<n>.ingest.de.sentry.io/<project>. The org is DE region
    (de.sentry.io), not US.
  2. Set it on Preview too — see Open questions, which the acceptance criteria below already
    decide.

Phase 2 — make the silence detectable (this repo)

  1. Add the smoke assertion. tests/smoke/boot-origins.smoke.test.ts already reads the eager
    graph off the deploy and asserts each origin the bundle will request; add the ingest host as a
    sibling entry in its REQUEST_ORIGINS list. A missing match must fail, not pass vacuously —
    that file's requestOrigins() already enforces exactly that, so follow it rather than writing a
    new shape. Verified locally: built with a DSN, the literal lands in dist/assets/Spinner-*.js,
    which sits in both the standalone and the embed eager graphs, so one read covers both, and
    pnpm size stays green (standalone 301.9/308 KiB, embed 303.7/308 KiB).

    ⚠ This spec can only ever see a preview. scripts/get-cloudflare-preview-url.mjs:169
    refuses the bare project host because "that is PRODUCTION, not any preview". So the assertion
    proves Preview carries a DSN and says nothing about Production. That is not a reason to skip it
    — Preview and Production are one build config away from each other, and the failure this ticket
    is about is a variable absent from an environment — but the acceptance criteria must not claim
    more than it proves.

  2. Name the Sentry environment explicitly. src/lib/report.ts:332 sets
    environment: import.meta.env.MODE, which is production for every vite build, preview
    included. With a Preview DSN, preview noise would be indistinguishable from production in the
    issue list. Take the environment from a variable Cloudflare can vary per environment instead,
    and default it to production. This also fixes the cross-repo inconsistency in Notes.

  3. Correct docs/environment.md:23. Three claims in that one row are stale:

    • it says to add the ingest host to "the integrator CSP guidance in README.md" — the CSP table
      lives in docs/embedding.md:796-813;
    • it gives the regional host as o….ingest.us.sentry.io — this org is DE;
    • it says "Hosts can decline it per embed with error-reporting="false"" — that veto is gone
      (src/loader/config.ts:29: "There are no privacy opt-outs"), and src/lib/report.ts:247-253
      plus src/lib/report.sentry.test.ts:131 both say the DSN is now the only gate.

    Record which environments hold the DSN in the same row, and state the Preview posture either
    way. Runbook step 1 (docs/environment.md:54) should stop reading "skip if already set" as an
    unchecked branch.

No CSP change is needed. docs/embedding.md:802 already carries *.sentry.io in the
connect-src row, and :811-813 explains the wildcard is that wide precisely so a regional host
(…de.sentry.io) matches. #123 did this. Delete this step rather than re-doing it.

Open questions

  • Should Preview carry a DSN too? Yes, and the acceptance criteria already require it — the
    smoke lane is the only automated observer, and it can reach nothing but a preview. Preview
    noise is the cost, bounded by MAX_EVENTS_PER_PAGE (src/lib/report.ts:240) and by the
    explicit environment tag in Phase 2 step 4. Overturn this only by moving the detection out of
    the smoke lane, which nothing currently supports.

Acceptance criteria

  • The sahajatlas Pages Production environment holds a non-empty VITE_SENTRY_DSN, and the
    deployed production bundle names its ingest host.
  • The Preview environment holds one too, so the smoke lane can observe it.
  • A deliberately thrown widget-root error arrives in sahajatlas-web carrying its ErrorKind
    tag. The thrown error must classify to server, config or unknown: offline,
    not-found and captcha-blocked are never reported (src/lib/report.ts:201-212).
  • Preview events are distinguishable from production ones in the Sentry issue list.
  • boot-origins.smoke.test.ts fails when the deploy under test carries no DSN, and fails —
    rather than passing empty — when the pattern stops matching.
  • docs/environment.md records which environments hold the DSN, states the Preview posture,
    and carries none of the three stale claims listed above.

Verification checklist

  • curl -s "https://de.sentry.io/api/0/projects/sy-developers/sahajatlas-web/issues/?query=&statsPeriod=14d" -H "Authorization: Bearer $SENTRY_CLAUDE_WORKFLOW_TOKEN" | jq length returns more than 0 after a test error.
  • VITE_SENTRY_DSN="https://[email protected]/1" pnpm build && grep -rlF ingest.de.sentry.io dist/assets names at least one chunk. Confirmed today: it names dist/assets/Spinner-*.js.
  • pnpm build && grep -rlF ingest dist/assets with VITE_SENTRY_DSN unset names nothing.
  • PREVIEW_URL=<a preview built without the DSN> pnpm test:smoke fails on boot origins.
  • curl -s https://sahajatlas.pages.dev/embed.js and its assets/*.js imports name the ingest host, after the next production deploy.
  • pnpm lint && pnpm typecheck && pnpm test:run pass, and pnpm build && pnpm size stays inside budget.

Notes

Found by the Tuesday Sentry survey (survey-sentry), 2026-09-29 — by the absence of data, not by an
error.

#108 wired the seam and explicitly left the DSN as a variable to document, not to provision. Its
own summary opens with "there is zero production error signal". That is still true, and this
ticket is the missing step plus the check that would have caught it.

No Sentry: link: there is no Sentry issue to point at, which is the finding.

Incidental: wemeditate-web reports under the environment name production-frontend, while
sahajcloud uses production. A sweep filtered on environment=production silently skips
WeMeditateWeb. Phase 2 step 4 is this repo's half of that; the other two repos are not in scope
here.

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

Activity

  1. added theissue type on Sep 29, 2026
  2. added
    proposal
    on Sep 29, 2026
  3. added
    bot:working
    and removed on Sep 29, 2026
  4. sydevs-bot commented on Sep 29, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running

    recent dispatches
    • 01:23Z implement · attempt 1 · session · done
    • 01:23Z implement · attempt 1 · session
    • 08:20Z revise · attempt 1 · session · done
    • 08:20Z revise · attempt 1 · session

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

  5. sydevs-bot commented on Sep 29, 2026

    @sydevs-bot
    ContributorAuthor

    Revised from the code and from the live deploy.

    • Diagnosis confirmed without a dashboard. The production bundle at sahajatlas.pages.dev names no ingest host, while it does name cloud.sydevelopers.com/api and report.ts's own literals. The seam ships. Only the DSN is missing.
    • Dropped the CSP step. docs/embedding.md:802 already carries *.sentry.io, and :811 says why the wildcard covers …de.sentry.io.
    • The smoke lane can only see a preview. scripts/get-cloudflare-preview-url.mjs:169 refuses production. So the open question is answered: Preview needs a DSN, or nothing automated observes this.
    • New step: name the Sentry environment. src/lib/report.ts:332 uses import.meta.env.MODE, which is production for every vite build. Preview events would be indistinguishable.
    • Split into two phases. Phase 1 is a dashboard action no run can do, and it must land first.

    Priority raised Medium → High: this is our only production signal. Effort stays Moderate. Type unchanged.

    @sydevs-bot implement starts the work.

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


    Generated by Claude Code

  6. added and removed
    bot:working
    on Sep 29, 2026
  7. Ardnived commented on Oct 2, 2026

    @Ardnived
    Contributor

    @sydevs-bot implement

  8. added
    bot:working
    and removed
    proposal
    bot:working
    on Oct 2, 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

    High

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions