Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Insights never generated on self-hosted: daily job filters on raw `subscriptionStatus = 'active'`

已关闭 适合新手
#597 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #598 来自 @grootbro —— 已合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, typescript
领域
analytics, backend

调研方向

从 packages/core/src/modules/insight/src/store.ts 开始,检查 listProjectIdsForCadence,每日作业 insightsDaily 使用它来选择项目。将其订阅筛选条件与 packages/core/src/modules/insight/insight.service.ts 中的每周摘要逻辑进行比较,并检查自托管部署如何处理订阅状态。确认候选查询包含符合条件的自托管项目,同时保留其他筛选条件。

由索引模型根据 Issue 内容生成。

描述

On a self-hosted instance the Insights page always shows "No insights found", for every project. I've been running the server since September and no insights have ever appeared, even on projects with well over 10k events and daily traffic.

Environment

  • OpenPanel 3.14.2, self-hosted (Docker), SELF_HOSTED=true
  • All worker queues enabled (ENABLED_QUEUES not set)

Cause

The insightsDaily cron job picks projects via listProjectIdsForCadence, which filters on the organization's subscription status: https://github.com/Openpanel-dev/openpanel/blob/03e63cd888510c29fdf615c4b9c22a9c7905f2ae/packages/core/src/modules/insight/src/store.ts#L56

On self-hosted this condition is never true:

The weekly digest already handles this. Its comment notes that computed fields can't be used in where, and it filters with { in: ['active', 'trialing'] } https://github.com/Openpanel-dev/openpanel/blob/03e63cd888510c29fdf615c4b9c22a9c7905f2ae/packages/core/src/modules/insight/insight.service.ts#L488 The insights candidate query doesn't.

The same filter is still on main.

Suggested fix

Skip the subscription filter when deps.config.selfHosted is true, or prefilter with { in: ['active', 'trialing'] } and refine with subscriptionState, the same way the weekly digest does.

Workaround

Set the raw column manually in Postgres:

UPDATE organizations
SET "subscriptionStatus" = 'active', "subscriptionEndsAt" = NULL
WHERE id = '<organization id>';

Insights then show up after the next 02:00 UTC run for projects that pass the other filters: more than 10k events and updated within the last 24h.

主要语言
TypeScript
星标
7.2k
派生
531
平均合并
23 小时 58 分钟
30 天内合并 PR
51

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Openpanel-dev/openpanel 的其他 Issue

查看 Openpanel-dev/openpanel 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。