From edbb5dd707e21cab58c956aa7a4bcc513654f673 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Thu, 23 Jan 2025 22:22:40 +0000 Subject: [PATCH] Remove distinct id in properties --- .../ingestion/event-pipeline/cookielessServerHashStep.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugin-server/src/worker/ingestion/event-pipeline/cookielessServerHashStep.ts b/plugin-server/src/worker/ingestion/event-pipeline/cookielessServerHashStep.ts index 9b4e92650c2bf9..76087e28f45f69 100644 --- a/plugin-server/src/worker/ingestion/event-pipeline/cookielessServerHashStep.ts +++ b/plugin-server/src/worker/ingestion/event-pipeline/cookielessServerHashStep.ts @@ -362,7 +362,7 @@ async function cookielessServerHashStepInner( }) const newEvent = { ...event } - const newProperties: Properties = { ...event.properties } + const newProperties: Properties = { ...event.properties, $distinct_id: undefined } newProperties['$device_id'] = hashToDistinctId(baseHashValue) const identifiesRedisKey = getRedisIdentifiesKey(baseHashValue, teamId) @@ -403,9 +403,7 @@ async function cookielessServerHashStepInner( hashExtra, }) // event before identify has been called, distinct id is the sentinel and needs to be replaced - const distinctId = hashToDistinctId(hashValue) - newEvent.distinct_id = distinctId - newProperties['$distinct_id'] = distinctId + newEvent.distinct_id = hashToDistinctId(hashValue) } else { const numIdentifies = await hub.db.redisSCard(identifiesRedisKey)