Skip to content

fix(source-maps): give detect dead ends a manual/docs path instead of exit-only#766

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/source-maps-detect-dead-ends
Draft

fix(source-maps): give detect dead ends a manual/docs path instead of exit-only#766
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/source-maps-detect-dead-ends

Conversation

@posthog

@posthog posthog Bot commented Jun 29, 2026

Copy link
Copy Markdown

Problem

Users hit dead ends partway through error-tracking / source-map setup in npx @posthog/wizard with no path forward. The live source-map flow runs an agentic detect screen (SourceMapsDetectScreen), and two of its branches were Exit-only:

  • "Nothing to instrument" — where React Native / iOS / Android / Flutter projects land. Native stacks have no automatable variant, so classify() marks every project non-instrumentable and the screen offers only Exit. This is the React Native bail described in the report.
  • "Detection failed" — a transient detector error dropped the user with a raw message and only Exit.

Both left users to restart from scratch or give up, which matches the convergent "unreliable mid-setup, no way back in" theme in the error-tracking wizard feedback.

Changes

  • Both detect dead ends now point at the manual source-map upload docs (posthog.com/docs/error-tracking/upload-source-maps) instead of an immediate exit.
  • The empty-detect copy is native-aware: when a React Native / iOS / Android / Flutter project is present, it says native apps aren't automated yet and notes the docs cover them too — turning the React Native bail into an actionable path.
  • The detection-failed state now suggests re-running (the error is usually transient) alongside the docs link.
  • Added an isNativePlatform helper (unit tested) that classifies native stacks from the agent's free-text framework label, used only to tailor the guidance.

Why: the error-tracking / source-map onboarding flow was a series of dead ends for paying customers (auth rejection, native bail, no iteration path). This PR addresses the two dead ends contained entirely in the source-map detect screen.

Scope note

This is a focused fix for the detect-screen dead ends only. The report also covers session persistence/resume after a crash, a post-change agent iteration path, in-process retry on the 401 AuthErrorScreen, and the Volta ECOMPROMISED message. Those are larger or riskier changes (the secret vault is intentionally non-persistent for security; 401 retry requires reworking the streaming agent run loop; the Volta error has no identified catch site in the wizard) and are deliberately left for separate, dedicated work rather than bundled here. Note also that the detect.ts:310-316 native bail referenced in the report is in the non-agentic detector, which is not wired into the live source-map step sequence — the observed React Native dead end is the agentic classify() → empty-detect path fixed here.

Test plan

  • pnpm build — clean.
  • pnpm test — all 1068 unit tests pass, including new isNativePlatform coverage.
  • pnpm lint — 0 errors (only pre-existing warnings, none in changed files).
  • Screen JSX follows the existing patterns in the same file and type-checks via the build. (This repo ships no .test.tsx screen render tests; ink@6 + React 19 reject component identity under vitest's transform.)

LLM context

Authored by PostHog Code (Claude) from an inbox report. Investigated the live vs. legacy detection paths, confirmed the React Native dead end manifests through the agentic detector's classify() rather than detect.ts, and scoped the fix to the two Exit-only detect-screen branches.


Created with PostHog Code from an inbox report.

… exit-only

The error-tracking source-map flow's agentic detect screen had two pure
dead ends: a "nothing to instrument" state (where React Native / iOS /
Android / Flutter projects land, since they have no automatable variant)
and a "detection failed" state, both offering only Exit.

Point both at the manual upload docs instead, and tailor the empty-state
copy when a native stack is present so those users get a path forward
rather than a flat exit. Detection failures now also suggest re-running.

Adds an `isNativePlatform` helper (unit tested) to detect native stacks
from the agent's framework label for the tailored guidance.

Generated-By: PostHog Code
Task-Id: 5d816e2b-983f-4537-8679-31f9958414c4
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci error-tracking-upload-source-maps
  • /wizard-ci mcp-analytics
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci error-tracking-upload-source-maps/android
  • /wizard-ci error-tracking-upload-source-maps/cicd-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-nested-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-github-actions-single-stage-docker-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-gitlab-node-raw
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-pnpm-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-monorepo-raw-node-react
  • /wizard-ci error-tracking-upload-source-maps/cicd-ssh-vps-node-raw
  • /wizard-ci error-tracking-upload-source-maps/flutter
  • /wizard-ci error-tracking-upload-source-maps/ios
  • /wizard-ci error-tracking-upload-source-maps/next
  • /wizard-ci error-tracking-upload-source-maps/next-no-posthog
  • /wizard-ci error-tracking-upload-source-maps/node-raw
  • /wizard-ci error-tracking-upload-source-maps/node-rollup
  • /wizard-ci error-tracking-upload-source-maps/node-rollup-typescript-plugin
  • /wizard-ci error-tracking-upload-source-maps/node-webpack
  • /wizard-ci error-tracking-upload-source-maps/nuxt-3-6
  • /wizard-ci error-tracking-upload-source-maps/nuxt-4-3
  • /wizard-ci error-tracking-upload-source-maps/react-native
  • /wizard-ci error-tracking-upload-source-maps/react-vite
  • /wizard-ci error-tracking-upload-source-maps/rust
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

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.

0 participants