From 0c8b2a54b34138e6785319ce7489d4dfacedf949 Mon Sep 17 00:00:00 2001 From: Krispire Admin Date: Mon, 8 Jun 2026 17:18:02 +0530 Subject: [PATCH] fix: push notification --- internal/service/push_sender.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/service/push_sender.go b/internal/service/push_sender.go index a50a001..59ac9a1 100644 --- a/internal/service/push_sender.go +++ b/internal/service/push_sender.go @@ -77,8 +77,10 @@ func (p *PushSender) SendToUser(ctx context.Context, userID string, payload Push Subscriber: p.subject, VAPIDPublicKey: p.pub, VAPIDPrivateKey: p.priv, - TTL: 60, - Urgency: webpush.UrgencyNormal, + // Hold the message for up to 6h so a sleeping/offline device + // still gets it on wake (60s would silently expire meanwhile). + TTL: 6 * 60 * 60, + Urgency: webpush.UrgencyNormal, }) if err != nil { p.logger.Warn("push: send failed", zap.String("user", userID), zap.Error(err))