From fc0e477141750a3de48f44556611cf632a4ff84e Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Wed, 25 Feb 2026 20:09:57 +0100 Subject: [PATCH] Include path in web push payload for backwards compatibility Old service workers cached in browsers still read `data.path` from the push notification payload. Include it alongside `data.url` so notification clicks keep working until those service workers update. Currently we only register the service worker in the notification settings screen, so this won't happen very often. Once we introduce offline mode, we'll register the service worker in more places, so we should be able to remove this. --- lib/web_push/notification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web_push/notification.rb b/lib/web_push/notification.rb index c01caa953..0d2e54c8d 100644 --- a/lib/web_push/notification.rb +++ b/lib/web_push/notification.rb @@ -20,7 +20,7 @@ class WebPush::Notification end def encoded_message - JSON.generate title: @title, options: { body: @body, icon: icon_path, data: { url: @url, badge: @badge } } + JSON.generate title: @title, options: { body: @body, icon: icon_path, data: { url: @url, path: @url, badge: @badge } } end def icon_path