log topic on BadWebPushTopic in message-delivery-method-web-push
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m11s

This commit is contained in:
2024-12-06 07:33:55 +02:00
parent 0d8c0d3183
commit c702800a99
@@ -1,4 +1,4 @@
import webpush from "web-push";
import webpush, { WebPushError } from "web-push";
const heartbeat = Number(process.env.HEARTBEAT_INTERVAL ?? 30_000);
@@ -159,6 +159,13 @@ const start = async () => {
`Error sending notification to owner ${row.id} - ${JSON.stringify((error as Error).message)}`,
error,
);
if (error instanceof WebPushError) {
if (error.body.includes("BadWebPushTopic")) {
console.error(
`Error topic=chat-${msgDoc.qr_code_uri}-${msgDoc.chat}`,
);
}
}
}
}
} else if (msgDoc.from === "owner") {