Retention matrix drops cohorts where nobody did the return event

Đang mở
#656 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@officialasishkumar đang làm issue này rồi.

Từ ngày 7/11/2026.

  • #659 của @officialasishkumar — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
sql, typescript
Lĩnh vực
analytics, databases

Hướng nghiên cứu

Start by reading packages/core/src/modules/chart/src/retention.sql.ts, especially retentionCohortQuery, and trace how cohorts and return events feed the matrix and Weighted Average. Check the tests for the retention query and its MCP and API consumers. Done means cohorts with no return events still appear with zero values and their users are included in the Weighted Average; an open linked pull request indicates work is already underway.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Description

In a retention report, a cohort none of whose users ever did the return event has no row in the matrix. With different start and return events (for example app_open, then purchase), those periods are missing from the table. Their users are also left out of the Weighted Average, which pools only cohorts with at least one return, so retention is overstated. When nobody has done the return event yet, the whole report looks like it has no data.

The MCP and API retention endpoints read the same query, so they have the same gap.

Steps to reproduce

  1. Create a retention report with start event app_open and return event purchase, interval Day.
  2. Pick a range where users who opened the app on one day never purchased.
  3. That day is missing from the matrix, and the Weighted Average divides only by the other cohorts.

Root cause

retentionCohortQuery (packages/core/src/modules/chart/src/retention.sql.ts) selects FROM interval_users LEFT JOIN cohort_sizes. interval_users is built from the inner join of cohort members with their return events, so a cohort with no returning user has no row there and drops out of the result.

Expected behavior

Every cohort appears with its size and zeros for the periods where nobody returned, and the Weighted Average includes those users.

Ngôn ngữ chính
TypeScript
Star
7.3k
Fork
539
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
80

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Openpanel-dev/openpanel

Tất cả issue của Openpanel-dev/openpanel

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.