PostHog / PostHog/posthog

Insights are showing multiple persons with 'is_organization_first_user' as true within the same organization

Open
#8,467 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
7h 27m
Merged PRs (30d)
222

Description

Bug description

I have an insight where I have filtered to show only the first users from an organization:

Screenshot 2022-02-07 at 17 18 34

However, the insight results will show me multiple users from that organization. And when you click into the person, they are marked as first user despite there being multiple team members in their account (weird screenshots for privacy):

Screenshot 2022-02-07 at 17 19 59 Screenshot 2022-02-07 at 17 19 54

More context in this thread from @tiina303 and @marcushyett-ph.

The problem seems to be that we're sending the wrong value here.

Expected behavior

Only the first user to sign up in an organization is included.

How to reproduce

  1. See this insight for an example, where multiple users from the same organization are marked as the 'first' user

Environment

  • PostHog Cloud
  • self-hosted PostHog (ClickHouse-based), version/commit: please provide
  • self-hosted PostHog (Postgres-based, legacy), version/commit: please provide

Additional context

Thank you for your bug report – we love squashing them!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in posthog/api/signup.py at the linked line 419 and inspect the value sent for is_organization_first_user. Reproduce the behavior with the linked insight and verify that filtering for true includes only the first user who signed up in an organization.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.