Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Chiusa Adatta ai principianti
#597 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #598 di @grootbro — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, typescript
Ambito
analytics, backend

Direzione di ricerca

Inizia da packages/core/src/modules/insight/src/store.ts ed esamina listProjectIdsForCadence, usato dal job giornaliero insightsDaily per selezionare i progetti. Confronta il relativo filtro dell’abbonamento con la logica del riepilogo settimanale in packages/core/src/modules/insight/insight.service.ts e verifica come viene gestito lo stato dell’abbonamento per le installazioni self-hosted. Conferma che la query dei candidati includa i progetti self-hosted idonei mantenendo gli altri filtri.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
7.2k
Fork
531
Merge medio
23h 58m
PR unite (30g)
51

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Openpanel-dev/openpanel

Tutte le issue di Openpanel-dev/openpanel

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.