-
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
fix: Webhooks groups properties #23822
Conversation
35bb54c
to
0d0414f
Compare
When we stopped writing groups on events (
Fixed that for you. "The right thing" is extremely subjective. |
@mariusandra this came from Product Analytics side, see #22764
|
I don't see how these two things are at odds. The conclusion is different. You concluded "let's kill it". I would've concluded "let's finish it (next month?) cause it'll be a nightmare to re-enable and backfill, so no action now". Notably missing is an analysis on either option. |
Unfortunately it would have required data fixing / backfill anyway, which I called this out in #22962
|
Don't forget, we're serving the customer here. The customer is using "frontend apps" like Product Analytics or Feature Flags to do what they need to do. Whatever would be great for users of Product Analytics (and the other products) should take priority over what inconveniences a team that effectively serves other teams, like Pipeline. PoE clearly was done to help end users with performance. GoE was discussed, but put on the back burner as the next step. Having it would obviously help with any query that uses group properties (enough users to matter, I've seen reports). We have also always said Groups should be a "first class citizen", whatever that means, so removing features from Groups seems like a steps backwards. In any case, please own up and fix the regression from webhooks (and CDP?), and/or communicate with the users why groups are not a first class citizen anymore if you choose that. |
I'm confused, this is exactly what this PR does |
Yes, thank you. If you need help with reviewing, let me know. It was still draft when I opened it earlier. |
I don't know much about these code paths, and since this is undoing a breaking change and people are talking about backfills it makes me nervous to breeze through this. I didn't review #22962 but is this just a revert of that change, or something more complicated? |
|
||
const queryString = `SELECT group_properties FROM posthog_group WHERE team_id = $1 AND group_type_index = $2 AND group_key = $3` | ||
|
||
const selectResult: QueryResult = await postgres.query( |
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 noting for others that the previous group code used a Redis cache before Postgres: https://github.com/PostHog/posthog/pull/22962/files#diff-0769dccc3458a7eb730036617ac32002072330fcdc5ec5a1d11364769d5dd5b6L488
Since this is just for Webhooks now and we're using a PG read replica this seems fine for now. If anything, it would be nice to do one query for all of them rather than a query each...
Problem
When we stopped writing groups on events (which was the right thing to do as it's not used in analytics queries and used up resources unnecessarily), then it broke webhooks using group properties.
This is innefficient as the comment says, but we don't want to spend too much time improving a legacy system that's going away soon.
Also made sure we don't accidentally break this functionality by adding a functional test for it.
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?