Skip to content

Commit

Permalink
don't skip writing overrides (so we can backfill posthog_personlessdi…
Browse files Browse the repository at this point in the history
…stinctid)
  • Loading branch information
bretthoerner committed Jun 24, 2024
1 parent 67c2681 commit 7ffda0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin-server/src/worker/ingestion/person-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7ffda0b

Please sign in to comment.