PostHog / plugin-server

Service to process and save PostHog events, supporting JS/TS plugins at that
https://posthog.com
8 stars 5 forks source link

Remove unused person creation path #608

Closed tiina303 closed 3 years ago

tiina303 commented 3 years ago

Changes

Goal: making future changes / refactor easier. We always have a person at this point, because the private updatePersonProperties is only called in capture where we have createPersonIfDistinctIdIsNew beforehand.

Same story for setIdentified at that point we should have a person already and if we don't throwing might be better than creating a person with no props nor other info, to make debugging easier.

Checklist

posthog-bot commented 3 years ago

Hey @tiina303! 👋 This pull request seems to contain no description. Please add useful context, rationale, and/or any other information that will help make sense of this change now and in the distant Mars-based future.

tiina303 commented 3 years ago

or is that there because someone could delete the distinct ID completely in the middle of the creation and update call? Based on my reading of the code delete only happens in a transaction, where we move the distinct ID first. Can a distinct ID be completely deleted somehow? What happens if someone deletes a person in the UI?