Insights never generated on self-hosted: daily job filters on raw `subscriptionStatus = 'active'`
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
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_QUEUESnot 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:
- Every organization is created with
subscriptionStatus: 'trialing'https://github.com/Openpanel-dev/openpanel/blob/03e63cd888510c29fdf615c4b9c22a9c7905f2ae/packages/core/src/modules/onboarding/onboarding.service.ts#L77 - The
SELF_HOSTEDoverride to'active'is a computed result field https://github.com/Openpanel-dev/openpanel/blob/03e63cd888510c29fdf615c4b9c22a9c7905f2ae/packages/db/src/prisma-client.ts#L48 It only applies on read, not inside awherefilter, so the query matches the raw column value'trialing'.
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Openpanel-dev/openpanel
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Openpanel-dev/openpanel#610 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ClickHouse retry logs print CLICKHOUSE_URL with its passwordForse già presa @ppjsw l’ha presa 10 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
Openpanel-dev/openpanel#551 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
login page needs refinementForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Openpanel-dev/openpanel#495 ·
I maintainer di solito rispondono entro 1 giorno
-
Dashboard dropdown pickers re-render on every animation frame while openForse già presa @MihirSachdeva l’ha presa 1 giorno fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 35/100
Openpanel-dev/openpanel#629 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
Openpanel-dev/openpanel#615 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Openpanel-dev/openpanel
Issue simili
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Export the Hemi Earn Router address and the Router and Agent ABIs from `@vetro-protocol/earn`Apertahemi-earn
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vetro-protocol/vetro-monorepo#1043 ·
I maintainer di solito rispondono entro 1 giorno
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
STRML/omp-classifier#206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
I maintainer di solito rispondono entro 1 giorno
-
dashboard enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Olanetsoft/agent-lookout#225 ·
I maintainer di solito rispondono entro 1 giorno