caelum0x 47188beb0c feat(product-analytics): close the plain (non-verbose) Mixpanel response contract
/track, /import, /engage and /groups always answered PostHog-shaped JSON
({"status":1}), but the official mixpanel SDKs default to verbose=0 and
treat any body other than the literal text "1" as a failure -- every
real SDK call against this service failed without verbose:true. Add
responseMode()/okResponse() in src/capture/routes.ts to read the
caller's own verbose query param (0/1, always explicitly sent by the real
SDKs) and answer plain "1"/"0" or JSON accordingly; a request that never
mentions verbose (this service's own PostHog-shaped SDKs) is unaffected
and keeps today's JSON body.

Verified against the real mixpanel npm client (not a mock) with its
actual default config end to end on track/people.set/groups.set, plus
raw-fetch checks of the literal body and content-type for verbose=0,
verbose=1 and no verbose param at all, in
test/qy/mixpanel-compat.test.ts. The other ingestion-compat gaps this
task was scoped to (/groups disambiguation, $add/$append/$union/$remove,
/import, lookup tables, data views) were already implemented and proven
in the prior 2026-10-15 pass -- confirmed by reading src/capture/routes.ts,
src/persons/properties.ts and the existing test suite before touching
anything, not re-done here. pnpm run test:all: 231 tests, 227 pass, 0
fail, 4 skipped (no cached Chromium, unrelated), up from 225/221/0/4.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-26 14:42:56 +03:00
..