fix(api): replace Sentry with PostHog for the hosted ORB Worker#8618
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 188bf3c | Commit Preview URL Branch Preview URL |
Jul 25 2026, 11:50 AM |
Bundle ReportBundle size has no change ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8618 +/- ##
=======================================
Coverage 92.76% 92.76%
=======================================
Files 797 797
Lines 79355 79355
Branches 24034 24034
=======================================
Hits 73616 73616
Misses 4592 4592
Partials 1147 1147
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-25 11:40:36 UTC
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
📋 Copy for AI agents — paste into your coding agentDecision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Removes the @sentry/hono/cloudflare middleware from routes.ts now that PostHog error tracking is a full replacement, not a parallel-run sink (2026-07-25 epic #8286 correction) -- the createWorkerPostHogErrorMiddleware added in #8288 already covers the same Context.error capture path. Drops @sentry/hono and @sentry/cloudflare from package.json (fully unused now) and the now-dead WORKER_SENTRY_DSN/WORKER_SENTRY_ENVIRONMENT Env fields.
65982f5 to
188bf3c
Compare
Summary
Completes the hosted-Worker leg of #8288 under epic #8286's 2026-07-25 strategy correction: PostHog now fully replaces Sentry on this surface (no parallel-run). Companion to #8617 (self-host's equivalent removal).
@sentry/hono/cloudflaremiddleware registration fromsrc/api/routes.ts—createWorkerPostHogErrorMiddleware()(PostHog error tracking for the hosted ORB Worker path (raw $exception, no SDK in the bundle) #8288) already covers the sameContext.errorcapture path Hono's own error-handling model routes through.@sentry/honoand@sentry/cloudflarefrompackage.json(fully unused now — verified vianpm ls).WORKER_SENTRY_DSN/WORKER_SENTRY_ENVIRONMENTEnvfields fromsrc/env.d.ts.src/api/worker-posthog.ts's doc comments and the two affected tests (cloudflare-worker-runtime-detection.test.ts,test/workers/worker-runtime.test.ts) that referenced the removed middleware.One real, narrow scope note (documented in
worker-posthog.ts): PostHog's middleware captures errors that propagate through Hono's dispatch chain, not a crash reachable only via the rawfetch()export outside Hono — Sentry's old middleware additionally patched the Worker's fetch export for that case via@sentry/cloudflare'swithSentry. This codebase has no PostHog equivalent for that specific edge, since every real route here is dispatched through Hono anyway.Test plan
npm run typecheck— cleannpm run test:cigate — 1155 test files / 21599 tests passed, 0 failuresnpm run test:workers(the Workers-pool suiteworker-runtime.test.tslives in) — 3/3 passnpm audit --audit-level=moderate— same 5 pre-existing high-severity findings asmain, unrelated