-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Person ID overrides by default #22811
Conversation
📸 UI snapshots have been updated3 snapshot changes in total. 0 added, 3 modified, 0 deleted:
Triggered by this commit. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but I'm not the best reviewer for this & I didn't really check query .ambr changes
dad46a7
to
12d4f97
Compare
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
if ensure_analytics_event_in_session: | ||
# Only importing from posthog.test.base if needed | ||
from posthog.test.base import _create_event, flush_persons_and_events | ||
|
||
# It's best to also create a random analytics event, since sessions querying does a JOIN with events in | ||
# any person-ID-on-events mode - sessions without an analytics event are excluded | ||
_create_event( | ||
distinct_id=data["distinct_id"], | ||
event="foobarino", | ||
properties={"$session_id": data["session_id"]}, | ||
team_id=team_id, | ||
) | ||
flush_persons_and_events() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This turned out to be necessary, as the session recordings query works quite differently with PersonsOnEventsMode.DISABLED
vs. with PersonsOnEventsMode.PERSON_ID_OVERRIDE_PROPERTIES_JOINED
. CC @PostHog/team-replay for a sanity check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep... we've got the laziest implementation possible right now.
i want to figure out how we can avoid having our own events query so we can just delegate completely
i guess we need to always select where session_id in (select $session_id from events where...)
or something but am letting future me deal with that 🤣
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone from replay should cross check impact
Co-authored-by: Anirudh Pillai <[email protected]>
@@ -831,6 +831,7 @@ def test_rolling_retention(self): | |||
_create_person(team_id=self.team.pk, distinct_ids=["person2"]) | |||
_create_person(team_id=self.team.pk, distinct_ids=["person3"]) | |||
_create_person(team_id=self.team.pk, distinct_ids=["person4"]) | |||
_create_person(team_id=self.team.pk, distinct_ids=["person5"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this test was off @aspicer
Changes
Person-on-events cleanup:
person_id_override_properties_joined
becomes the default in code (we can get rid of thepersons-on-events-person-id-override-properties-joined
flag after this)Team.person_on_events_mode
is now consistent with the project setting (which is based onTeam.modifiers
) – previouslyTeam.person_on_events_mode
didn't know about the project setting (although this only applies to projects where the setting was explicitly changed)person-on-events-enabled
flag