Compare commits

..

2 Commits

Author SHA1 Message Date
cd0ae19d03 Log FCM env value on test-push requests.
Add request-time logging in the test push endpoint so FCM_SERVICE_ACCOUNT_KEY can be verified during each API call, not only at service startup.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 09:56:45 -07:00
75353f8bdd Log FCM service account env value at startup.
Add a notification-service startup log to print FCM_SERVICE_ACCOUNT_KEY for runtime verification during push notification troubleshooting.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 09:54:22 -07:00
2 changed files with 7 additions and 0 deletions

View File

@ -68,6 +68,10 @@ func New(
config: cfg,
}
mongoLogger.Info("FCM_SERVICE_ACCOUNT_KEY value at startup",
zap.String("fcm_service_account_key", cfg.FCMServiceAccountKey),
)
// Initialize FCM client if service account key is provided
if cfg.FCMServiceAccountKey != "" {
if err := svc.initFCMClient(); err != nil {

View File

@ -727,6 +727,9 @@ func (h *Handler) RegisterDeviceToken(c *fiber.Ctx) error {
func (h *Handler) SendTestPushNotification(c *fiber.Ctx) error {
title := c.FormValue("title", "Test Push Notification")
message := c.FormValue("message", "This is a test push notification from Yimaru Backend")
h.mongoLoggerSvc.Info("FCM_SERVICE_ACCOUNT_KEY value during test-push call",
zap.String("fcm_service_account_key", h.Cfg.FCMServiceAccountKey),
)
userID, ok := c.Locals("user_id").(int64)
if !ok || userID == 0 {