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

Đang mở
#2,137 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Wikid82 đang làm issue này rồi.

Từ ngày 3/12/2026.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
17
Fork
2
Merge trung bình
1 giờ 42 phút
Pull request đã merge (30 ngày)
173

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Wikid82/Charon

Tất cả issue của Wikid82/Charon

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.