From d7c9c4f3b0212b2a90642cdb5db89b50b1dfec72 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Fri, 23 Jan 2026 11:59:27 +0000 Subject: [PATCH] Remove unnecessary `await` in push handler We were `await`ing a synchronous method here, which will have the effect of deferring its execution, and thus also the `event.waitUntil` call. We want the latter to happen before control returns from the event. Removing the unnecessary `await` solves this. This seems unlikely to be a problem in practice, but all the same, it's not right :) --- app/views/pwa/service_worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/pwa/service_worker.js b/app/views/pwa/service_worker.js index df284d578..1216c550d 100644 --- a/app/views/pwa/service_worker.js +++ b/app/views/pwa/service_worker.js @@ -9,8 +9,8 @@ self.addEventListener('fetch', (event) => { } }) -self.addEventListener("push", async (event) => { - const data = await event.data.json() +self.addEventListener("push", (event) => { + const data = event.data.json() event.waitUntil(Promise.all([ showNotification(data), updateBadgeCount(data.options) ])) })