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
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m11s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import webpush from "web-push";
|
import webpush, { WebPushError } from "web-push";
|
||||||
|
|
||||||
const heartbeat = Number(process.env.HEARTBEAT_INTERVAL ?? 30_000);
|
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 sending notification to owner ${row.id} - ${JSON.stringify((error as Error).message)}`,
|
||||||
error,
|
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") {
|
} else if (msgDoc.from === "owner") {
|
||||||
|
|||||||
Reference in New Issue
Block a user