Skip to content

Fix PostHog transport in Cloudflare Workers - #38

Merged
yaacovcorcos merged 1 commit into
mainfrom
codex/analytics-transport-20260908
Sep 8, 2026
Merged

Fix PostHog transport in Cloudflare Workers#38
yaacovcorcos merged 1 commit into
mainfrom
codex/analytics-transport-20260908

Conversation

@yaacovcorcos

Copy link
Copy Markdown
Contributor

Summary

  • keep PostHog credentials scoped to the configured origin by handling redirects manually instead of following them
  • avoid Cloudflare treating redirect: error as a failed subrequest before the response can be classified
  • test that redirect responses are rejected as HTTP failures without being followed

Production evidence

The staged synthetic event was accepted into D1 but the current Worker recorded repeated network failures before receiving a PostHog response. This changes only the transport redirect mode; timeouts, bounded responses, origin scoping, retries, and HTTP rejection remain intact.

Qualification

  • full website/Worker check suite passes
  • 137 tests pass, 1 skipped
  • site and Pages Functions builds pass

After merge, deploy the exact merge commit and repeat the isolated ingest/export/deletion proof.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying scientfactory-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2d41370
Status: ✅  Deploy successful!
Preview URL: https://1cdf0f72.scientfactory-website.pages.dev
Branch Preview URL: https://codex-analytics-transport-20.scientfactory-website.pages.dev

View logs

@yaacovcorcos
yaacovcorcos merged commit c7d1fda into main Sep 8, 2026
2 checks passed
@yaacovcorcos
yaacovcorcos deleted the codex/analytics-transport-20260908 branch September 8, 2026 16:52
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