Skip to content

[codex] Track landing downloads server-side - #102

Merged
SawyerHood merged 1 commit into
mainfrom
codex/landing-download-tracking
Jun 12, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
codex/landing-download-tracking

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Summary

  • Route landing page macOS download CTAs through a first-party /download/macos Worker redirect.
  • Record landing_download_macos_clicked server-side with PostHog before redirecting to the GitHub release URL.
  • Keep static asset serving direct through Cloudflare assets, and document the analytics/deploy secret flow.

Why

Client-side PostHog download click events can be blocked by ad blockers because they load and send to PostHog domains from the browser. A first-party redirect lets the download continue normally while recording the click from the Worker runtime.

Validation

  • pnpm exec turbo run typecheck --filter=@bb/landing
  • pnpm exec turbo run build --filter=@bb/landing
  • pnpm exec turbo run lint --filter=@bb/landing
  • pnpm --filter @bb/landing exec wrangler deploy --dry-run --outdir /tmp/bb-landing-worker-dry-run
  • git diff --check

@SawyerHood
SawyerHood marked this pull request as ready for review June 12, 2026 17:08
@SawyerHood
SawyerHood merged commit fa8b4ea into main Jun 12, 2026
6 checks passed
@SawyerHood
SawyerHood deleted the codex/landing-download-tracking branch June 12, 2026 17:09
ymichael added a commit that referenced this pull request Aug 20, 2026
## What was wrong

The first-run setup guide shipped behind the `newOnboarding` experiment,
which defaults to false (`packages/domain/src/experiments.ts`) and was
never enabled by default. Nobody saw the flow unless they turned the
toggle on by hand, so its UI, its telemetry funnel, its persisted
completion timestamp, and a dedicated host-daemon command existed to
serve a surface that never ran — spread across seven packages.

## What changed

Deleted the experiment and everything that existed only for it:

- `OnboardingHost` / `OnboardingFlow` (828 lines) and their `App.tsx`
mount.
- The `newOnboarding` experiment key, its Settings → Experiments toggle
(web and `apps/mobile`), and every config fixture that listed it.
- `appSettingsSchema.onboardingCompletedAt`, the Settings → General
"Setup guide" replay control, and `bb settings replay-onboarding`. No
migration is needed: since #102 app settings are key/value rows read
through `inArray(key, appSettingsKeys)`, so the retired key's row is
ignored. The legacy wide `app_settings` table keeps its column, which is
deliberately frozen for `seedKeepAwakePluginConfiguration`.
- The five onboarding funnel telemetry events, `POST
/system/onboarding/event`, and `sdk.system.onboardingEvent`.
- `GET /system/onboarding/repos`, `sdk.system.onboardingRepos`, and —
since nothing else sent it — the `workspace.discover_repos` daemon
command with its 460-line handler.

**Wire change: `HOST_DAEMON_PROTOCOL_VERSION` 137 → 138**, because a
command left the protocol. The reason is recorded in the `protocol.ts`
header.

Docs and agent surfaces updated in the same change:
`bb-guide-customization.md` (regenerated), the `bb-cli` SKILL and its
`app-settings` reference, `bb-plugin-authoring`'s SDK method table, and
`docs/configuration.md`.

`getOnboardingAgentOverview` and `GET /system/onboarding/agents`
deliberately stay. Despite the name they are not onboarding-only: the
root composer resolves an unset provider selection through
`useOnboardingAgents` (`useThreadCreationOptions.ts` ←
`RootComposeView.tsx`), which ships unconditionally. Renaming that
endpoint and its SDK method to match its real purpose is a follow-up,
not part of a deletion. `useOnboardingAgents` does lose its `poll`
option, which became constant once the flow's caller went away.

Two test adjustments worth calling out, both because their subject was
deleted rather than because they broke:

- `apps/cli` had a test using `onboardingCompletedAt` as its
nullable-string case for `bb settings general`. `appSettingsSchema` now
holds only booleans, so that path has no live key to exercise; the test
is trimmed to the unknown-key assertion it also covered. The generic
value-parsing code in `updateGeneralSetting` is untouched and still
accepts `null`.
- `packages/db`'s key/value migration test no longer asserts a settings
field that no longer exists.

## How you verified

Nothing here is a behavior fix, so the evidence is that removing a
never-enabled surface changes nothing else:

- `pnpm exec turbo run typecheck` — 72/72 tasks green.
- `pnpm exec turbo run test` for `@bb/app` (3037), `@bb/server` (1787),
`@bb/mobile` (812), `@bb/host-daemon` (47 files), plus `@bb/db`,
`@bb/domain`, `@bb/sdk`, `@bb/cli`, `@bb/desktop`,
`@bb/server-contract`, `@bb/host-daemon-contract`, `@bb/templates`,
`@get-bb/plugin-sdk` — all green.
- `pnpm exec turbo run lint` — 0 errors (144 pre-existing react-compiler
warnings in `@bb/app`, unchanged).
- `packages/host-daemon-contract`'s protocol-version test pins 138, and
its command-fixture map no longer accepts `workspace.discover_repos`, so
a stray sender fails the contract test.
- Repo-wide grep for `newOnboarding`, `onboardingCompletedAt`,
`replay-onboarding`, `onboardingRepos`, `onboardingEvent`, and
`discover_repos` returns only the `protocol.ts` changelog note.

No CHANGELOG entry: per `docs/bb-release-process.md` those sections are
written at release-prep time, and this removes nothing a user could see.

Fixes: N/A — no linked issue.

> AGENT GENERATED: by Claude Opus 5

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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