From 7ffda0b72a553c7bf3290960667dc58296ef9411 Mon Sep 17 00:00:00 2001 From: Brett Hoerner Date: Mon, 24 Jun 2024 13:08:43 -0600 Subject: [PATCH] don't skip writing overrides (so we can backfill posthog_personlessdistinctid) --- plugin-server/src/worker/ingestion/person-state.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-server/src/worker/ingestion/person-state.ts b/plugin-server/src/worker/ingestion/person-state.ts index ec4afa2284f3d7..6407e8f7e0a729 100644 --- a/plugin-server/src/worker/ingestion/person-state.ts +++ b/plugin-server/src/worker/ingestion/person-state.ts @@ -507,12 +507,12 @@ export class PersonState { 'mergeDistinctIds-OneExists', async (tx) => { // See comment above about `distinctIdVersion` - const insertedDistinctId = await this.db.addPersonlessDistinctIdForMerge( + const _insertedDistinctId = await this.db.addPersonlessDistinctIdForMerge( this.teamId, distinctIdToAdd, tx ) - const distinctIdVersion = insertedDistinctId ? 0 : 1 + const distinctIdVersion = 1 // TODO: Once `posthog_personlessdistinctid` is backfilled: insertedDistinctId ? 0 : 1 await this.db.addDistinctId(existingPerson, distinctIdToAdd, distinctIdVersion, tx) return [existingPerson, Promise.resolve()] @@ -562,7 +562,7 @@ export class PersonState { // whether we can optimize away an override by doing a swap, or whether we // need to actually write an override. (But mostly we're being verbose for // documentation purposes) - let distinctId2Version = 0 + let distinctId2Version = 1 // TODO: Once `posthog_personlessdistinctid` is backfilled, this should be = 0 if (insertedDistinctId1 && insertedDistinctId2) { // We were the first to insert both (neither was used for Personless), so we // can use either as the primary Person UUID and create no overrides.