Retention matrix drops cohorts where nobody did the return event

オープン
#656 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@officialasishkumar がすでに取り組んでいます。

2026年11月7日 から。

  • #659 @officialasishkumar による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
sql, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
7.3k
フォーク
539
平均マージ
1日 20時間
マージ済み PR(30日)
80

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Openpanel-dev/openpanel のほかの issue

Openpanel-dev/openpanel の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。