From 3ac60b77e82e28968a5f742e753b391b38ff633f Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Tue, 4 Aug 2026 10:33:37 -0700 Subject: [PATCH] Fix PostHog endpoint event identity --- lith/product-analytics.mjs | 2 +- system/tests/posthog-server.test.mjs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lith/product-analytics.mjs b/lith/product-analytics.mjs index 01c253d7a..1470aca86 100644 --- a/lith/product-analytics.mjs +++ b/lith/product-analytics.mjs @@ -92,10 +92,10 @@ export function createEndpointAnalytics({ flushing = (async () => { const batch = [...pending.values()].map(({ count, ...properties }) => ({ event: "ac endpoint completed", + distinct_id: "ac-lith-endpoint-aggregate", properties: { ...properties, count, - distinct_id: "ac-lith-endpoint-aggregate", $process_person_profile: false, $geoip_disable: true, }, diff --git a/system/tests/posthog-server.test.mjs b/system/tests/posthog-server.test.mjs index 90276e2da..16671ddb7 100644 --- a/system/tests/posthog-server.test.mjs +++ b/system/tests/posthog-server.test.mjs @@ -78,6 +78,8 @@ test("server capture is opt-in, batched, anonymous, and payload-free", async () (event) => event.properties.endpoint === "device-token", ); assert.equal(endpointEvent.properties.count, 2); + assert.equal(endpointEvent.distinct_id, "ac-lith-endpoint-aggregate"); + assert.equal(Object.hasOwn(endpointEvent.properties, "distinct_id"), false); assert.equal(body.batch[0].properties.$process_person_profile, false); assert.equal(body.batch[0].properties.$geoip_disable, true); assert.equal(Object.hasOwn(body.batch[0].properties, "path"), false); -- 2.51.2