fix: push delivery when app is closed
- TTL 30s -> 86400 (24h): push services were dropping undelivered notifs - Urgency: high: wakes device from doze/sleep - Topic: per-user to collapse duplicate pending pushes - SW push handler: try/catch for malformed payloads, always call waitUntil - Bump SW cache to v6
This commit is contained in:
@@ -167,7 +167,9 @@ func (h *Handler) SendPush(ctx context.Context, userID string, payload map[strin
|
||||
Subscriber: h.vapidSubj,
|
||||
VAPIDPublicKey: h.vapidPub,
|
||||
VAPIDPrivateKey: h.vapidPriv,
|
||||
TTL: 30,
|
||||
TTL: 86400,
|
||||
Urgency: webpush.UrgencyHigh,
|
||||
Topic: userID,
|
||||
})
|
||||
if err != nil {
|
||||
h.logger.Error("failed to send push", "error", err, "user_id", userID)
|
||||
@@ -242,7 +244,9 @@ func (h *Handler) SendChannelNotification(ctx context.Context, channelID, author
|
||||
Subscriber: h.vapidSubj,
|
||||
VAPIDPublicKey: h.vapidPub,
|
||||
VAPIDPrivateKey: h.vapidPriv,
|
||||
TTL: 30,
|
||||
TTL: 86400,
|
||||
Urgency: webpush.UrgencyHigh,
|
||||
Topic: userID,
|
||||
})
|
||||
if err != nil {
|
||||
h.logger.Error("failed to send push", "error", err, "user_id", userID)
|
||||
|
||||
Reference in New Issue
Block a user