posthog icon indicating copy to clipboard operation
posthog copied to clipboard

Feature request(Cohorts): Edit history for cohorts

Open Sriram-bk opened this issue 1 year ago • 2 comments

Feature request

Is your feature request related to a problem?

There currently isn't a way to track changes made to cohorts.

Additional context in Zendesk linked below.

Describe the solution you'd like

Add the ability to track and display edit history for cohorts.

Describe alternatives you've considered

Additional context

From : https://posthoghelp.zendesk.com/agent/tickets/26873 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/28882)

Debug info

- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Sriram-bk avatar Mar 14 '25 13:03 Sriram-bk

I think this one can be closed. #57702 shipped cohort edit history in May and listed this issue as closed by it, but the auto-close didn't fire.

What I checked on current master (587f4d0):

  • Saved cohorts have a History tab that renders the activity log for the cohort (frontend/src/scenes/cohorts/CohortEdit.tsx:585).

  • Every create or edit through the Cohorts UI, the /cohorts API or the MCP cohort tools logs an entry for the cohort you acted on:

    • create, update (with a field diff), delete and restore, through perform_create and perform_update in posthog/api/cohort.py;
    • manual person additions and removals on static cohorts;
    • the realtime toggle.

    The MCP tools call the same endpoints. Turning realtime on also turns it on for included cohorts, but only the cohort you acted on gets an entry.

  • Tests assert the entries for create, update, delete and restore, manual removal and the realtime toggle, and breaking any of those paths turns a test red (CI run). The manual addition entry isn't covered by a test.

  • The describer in frontend/src/scenes/cohorts/activityDescriptions.tsx renders all of those activities, and later commits only extended it.

One thing History doesn't cover yet: some Workflows paths (a workflow step adding a person, a Workflows people upload, or a provider contact import replacing members). Those go through the Workflows product rather than the Cohorts editor or the /cohorts API, so I don't think they need to keep this issue open, but I'm happy to open a separate one if you'd like them in History.

jadibdev avatar Nov 24 '26 08:11 jadibdev

PostHog self-driving picked up this issue. Status: Research is done.

Somebody may already be working on it, so ask before you start a fix.

Report (team access only): https://us.posthog.com/project/2/inbox/reports/01a20cd8-10a4-7781-ab41-55f7322d1a94?link_source=github_comment

posthog[bot] avatar Nov 24 '26 09:11 posthog[bot]