From 9aa70027f2d07ba4409451cbc776c97d1c2be4b8 Mon Sep 17 00:00:00 2001 From: Josh Kasten Date: Tue, 30 Apr 2024 18:14:51 -0400 Subject: [PATCH 1/2] fix webhook display event remote config Since 160000 we have been using the wrong remote config key for the webhook display event url. Reverted to the old name to correct the issue. --- src/shared/helpers/ConfigHelper.ts | 2 +- src/shared/models/AppConfig.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/helpers/ConfigHelper.ts b/src/shared/helpers/ConfigHelper.ts index c6b501a8a..cda59b9fd 100644 --- a/src/shared/helpers/ConfigHelper.ts +++ b/src/shared/helpers/ConfigHelper.ts @@ -581,7 +581,7 @@ export class ConfigHelper { webhooks: { cors: serverConfig.config.webhooks.corsEnable, 'notification.willDisplay': - serverConfig.config.webhooks.notificationWillDisplayHook, + serverConfig.config.webhooks.notificationDisplayedHook, 'notification.clicked': serverConfig.config.webhooks.notificationClickedHook, 'notification.dismissed': diff --git a/src/shared/models/AppConfig.ts b/src/shared/models/AppConfig.ts index 887dfe560..a23d155c5 100755 --- a/src/shared/models/AppConfig.ts +++ b/src/shared/models/AppConfig.ts @@ -234,7 +234,7 @@ export interface ServerAppConfig { corsEnable?: boolean; notificationClickedHook?: string; notificationDismissedHook?: string; - notificationWillDisplayHook?: string; + notificationDisplayedHook?: string; }; integration: { kind: ConfigIntegrationKind; From 0e919a7448b3a2970bdb60b6928ac3621948f119 Mon Sep 17 00:00:00 2001 From: Josh Kasten Date: Tue, 30 Apr 2024 18:24:03 -0400 Subject: [PATCH 2/2] correct dismissed event name This incorrect naming was causing the webhook not to fire, since it was looking for the wrong key in IndexedDB --- .../payloads/OSWebhookPayloadNotificationDismiss.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sw/webhooks/notifications/payloads/OSWebhookPayloadNotificationDismiss.ts b/src/sw/webhooks/notifications/payloads/OSWebhookPayloadNotificationDismiss.ts index 10339fbce..783f3c619 100644 --- a/src/sw/webhooks/notifications/payloads/OSWebhookPayloadNotificationDismiss.ts +++ b/src/sw/webhooks/notifications/payloads/OSWebhookPayloadNotificationDismiss.ts @@ -4,7 +4,7 @@ import { IOSNotification } from '../../../../shared/models/OSNotification'; export class OSWebhookPayloadNotificationDismiss implements IOSWebhookEventPayload { - readonly event: string = 'notification.dismiss'; + readonly event: string = 'notification.dismissed'; readonly notificationId: string; readonly heading?: string; readonly content: string;