Skip to content
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: rolling retention #24926

Merged
merged 5 commits into from
Sep 12, 2024
Merged

fix: rolling retention #24926

merged 5 commits into from
Sep 12, 2024

Conversation

aspicer
Copy link
Contributor

@aspicer aspicer commented Sep 11, 2024

Problem

Rolling retention wasn't calculated correctly
https://posthoghelp.zendesk.com/agent/tickets/17978
https://posthoghelp.zendesk.com/agent/tickets/18002

Changes

Convert the calculation to the backend and calculate it correctly.

Normal
image

Rolling
image

Sep 2 Cohort Breakout
image

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Wrote a test, manually verified.

@aspicer aspicer requested a review from a team September 11, 2024 22:16
Copy link
Contributor

github-actions bot commented Sep 11, 2024

Size Change: 0 B

Total Size: 1.1 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.1 MB

compressed-size-action

@@ -35,7 +35,7 @@ export function RetentionTable({ inCardView = false }: { inCardView?: boolean })

{showMean && tableRows.length > 0 ? (
<tr className="border-b" key={-1}>
{range(0, tableRows[0].length).map((columnIndex) => (
{range(0, tableRows[0].length - 1).map((columnIndex) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just missing why you're doing -1 here + the check on line 50 if (columnIndex < row.length - 1) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed you increment intervals_from_base but only happens for cumulative

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - I just blindly reverted the FE changes from #24240 but this seems like it was an unrelated bug fix.

The means seem like they're properly working now.

image

@aspicer aspicer merged commit f92cff2 into master Sep 12, 2024
93 checks passed
@aspicer aspicer deleted the aspicer/rolling_retention branch September 12, 2024 16:50
abhi12299 pushed a commit to abhi12299/posthog that referenced this pull request Sep 13, 2024
Copy link

sentry-io bot commented Sep 16, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ SyntaxError: mismatched input 'person_id' expecting posthog.tasks.tasks.process_query_task View Issue
  • ‼️ SyntaxError: mismatched input '$group_2' expecting posthog.tasks.tasks.process_query_task View Issue
  • ‼️ Action.DoesNotExist: Action matching query does not exist. posthog.tasks.tasks.process_query_task View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants