chore: align the feature flag list with the notification settings it reports

Aperta
#2,137 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Wikid82 ci sta già lavorando.

Dal 3/12/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Read backend/internal/api/handlers/feature_flags_handler.go and backend/internal/services/notification_service.go, then inspect backend/internal/services/notification_feature_flags.go and the existing handler tests. Compare the endpoint's notification flag keys and defaults with those used by dispatch. Done when the endpoint reports matching defaults, omits unread keys, and a test checks the defaults agree.

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

Descrizione

backend low

What

GET /api/v1/feature-flags reports values for notification settings that differ from what notification sending uses, and lists two keys that nothing reads.

  • backend/internal/api/handlers/feature_flags_handler.go:36-60 lists feature.notifications.service.gotify.enabled, ...webhook.enabled and ...telegram.enabled with a default of false. When no stored setting exists, NotificationService.isDispatchEnabled (backend/internal/services/notification_service.go, getFeatureFlagValue(..., true)) treats the same keys as true and sends. The endpoint therefore reports these provider types as off while Charon sends to them.
  • feature.notifications.service.slack/pushover/ntfy/webpush.enabled are read by isDispatchEnabled but not listed by the endpoint.
  • feature.notifications.engine.notify_v1.enabled and feature.notifications.service.discord.enabled are listed, but no code reads them (FlagNotifyEngineEnabled and FlagDiscordServiceEnabled in backend/internal/services/notification_feature_flags.go have no reader).

Severity

Low. No user-facing page reads these keys; scripts reading the endpoint get values that do not match sending.

Suggested approach

Derive the notification entries of defaultFlags / defaultFlagValues from one table shared with isDispatchEnabled (key + default), drop the two keys nothing reads, and add a test that the endpoint's defaults equal the dispatch defaults.

Found while planning #2132.

Lingua principale
Go
Stelle
17
Fork
2
Merge medio
1h 42m
PR unite (30g)
173

Preparare l'ambiente

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 Wikid82/Charon

Tutte le issue di Wikid82/Charon

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.