Skip to content

[CI] (cef44b4) stripe/stripe-next-js-saas-starter#1411

Closed
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-cef44b4-stripe-stripe-next-js-saas-starter
Closed

[CI] (cef44b4) stripe/stripe-next-js-saas-starter#1411
wizard-ci-bot[bot] wants to merge 1 commit intomainfrom
wizard-ci-cef44b4-stripe-stripe-next-js-saas-starter

Conversation

@wizard-ci-bot
Copy link
Copy Markdown

@wizard-ci-bot wizard-ci-bot Bot commented May 1, 2026

Automated wizard CI run

Source: context-mill-pr
Trigger ID: cef44b4
App: stripe/stripe-next-js-saas-starter
App directory: apps/stripe/stripe-next-js-saas-starter
Workbench branch: wizard-ci-cef44b4-stripe-stripe-next-js-saas-starter
Wizard branch: main
Context Mill branch: basic-skills-v2
PostHog (MCP) branch: master
Timestamp: 2026-05-01T21:17:46.353Z
Duration: 124.2s

@wizard-ci-bot
Copy link
Copy Markdown
Author

wizard-ci-bot Bot commented May 1, 2026

Now I have a complete picture. Let me produce the evaluation.


PR Evaluation Report — Revenue Analytics

Summary

This PR adds posthog_person_distinct_id metadata to the Stripe checkout session and subscription_data in createCheckoutSession(), enabling PostHog to link Stripe customers back to PostHog persons. However, the PR is critically incomplete — it does not add any posthog.capture() calls for revenue events from the webhook handler, meaning no revenue data (amounts, currency) will flow into PostHog.

Files changed Lines added Lines removed
2 +57 -1

Confidence score: 3/5 🤔

  • No revenue event captures in webhook handler: The PR does not add any posthog.capture() calls for revenue-relevant Stripe events (invoice.paid, checkout.session.completed, etc.) with amount/currency properties. The existing webhook handler has pre-existing captures for subscription_updated/subscription_canceled, but those were not added by this PR and lack revenue data (no amount, no currency). [CRITICAL]
  • No revenue-shaped events emitted: PostHog's revenue analytics product requires events with amount/revenue and currency properties. This PR emits zero such events. Without these, the metadata threading is necessary but insufficient — revenue dashboards will remain empty. [CRITICAL]
  • Pre-existing webhook distinct_id mismatch: The existing webhook handler uses customerId (Stripe customer ID like cus_xxx) as distinctId, which does not match the app's canonical String(user.id). The PR should have fixed this to use the posthog_person_distinct_id from subscription metadata, but did not. [MEDIUM — pre-existing issue the wizard should have addressed]

File changes

Filename Score Description
lib/payments/stripe.ts 3/5 Adds posthog_person_distinct_id metadata to checkout session and subscription_data — correct but insufficient on its own
posthog-revenue-report.md 2/5 Documentation of changes; claims revenue analytics is wired but the actual webhook capture work is missing

App sanity check ✅

Criteria Result Description
App builds and runs Yes Simple metadata addition, no syntax issues
Preserves existing Stripe integration Yes Only adds metadata fields; no existing behavior modified
No syntax or type errors Yes Valid syntax, correct Stripe metadata shape
Correct imports/exports Yes No new imports needed for metadata addition
Minimal, focused changes Yes Changes are minimal (arguably too minimal — missing core revenue capture work)
Pre-existing issues Webhook uses Stripe customerId as PostHog distinctId instead of user.id; existing captures lack amount/currency

Issues

  • Report markdown overstates completeness: The posthog-revenue-report.md claims revenue analytics is configured, but without webhook captures emitting revenue-shaped events, revenue dashboards won't populate. [LOW]

Stripe ↔ PostHog wiring ⚠️

Criteria Result Description
distinct_id threaded into Stripe metadata Yes posthog_person_distinct_id: user.id.toString() added to both session-level and subscription_data metadata
Webhook captures revenue events No PR adds zero posthog.capture() calls. Pre-existing webhook captures exist but lack amount/currency and were not added by this PR
Server uses posthog-node No PR adds no server-side captures. Pre-existing code uses posthog-node but that's not attributable to this PR
distinct_id matches existing usage Yes user.id.toString() matches the app's String(user.id) pattern used in posthog.identify() calls
Consistent currency handling No No currency is captured in any event — neither added nor fixed by this PR

Issues

  • Missing webhook revenue captures: The core purpose of the revenue wizard is to emit posthog.capture() calls with revenue data from the Stripe webhook. This PR only threads metadata but never captures revenue events like invoice.paid, checkout.session.completed with amount and currency. [CRITICAL]
  • Pre-existing distinct_id mismatch in webhook: The existing webhook (line 35) uses customerId (Stripe customer ID) as distinctId, not the canonical user.id. The wizard added posthog_person_distinct_id to subscription metadata but never reads it back in the webhook to fix the distinct_id. [MEDIUM]

Revenue events ❌

Filename Revenue events captured Description
app/api/stripe/webhook/route.ts None added by PR Pre-existing: subscription_updated, subscription_canceled — but without amount/currency and not added by this PR
app/api/stripe/checkout/route.ts None added by PR Pre-existing: checkout_completed — but without amount/currency

Issues

  • Zero revenue events added: The PR adds no new posthog.capture() calls. Revenue analytics requires events with amount/revenue and currency properties — none exist. [CRITICAL]
  • No amount or currency on any event: Neither the PR's changes nor the pre-existing events include revenue amounts or currency codes. PostHog cannot build revenue dashboards without these. [CRITICAL]
  • Missing key revenue event types: No handling for invoice.paid, invoice.payment_failed, customer.subscription.created — all important for comprehensive revenue analytics. [MEDIUM]

Reviewed by wizard workbench PR evaluator (revenue analytics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants