Made "notification:send" action idempotent

Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
Bogdan Nechyporenko
2025-03-18 20:55:31 +01:00
parent 403bb43d3d
commit 25a76750a7
2 changed files with 13 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-notifications': patch
---
Made "notification:send" action idempotent
@@ -133,9 +133,14 @@ export function createSendNotificationAction(options: {
};
try {
await notifications.send({
recipients: notificationRecipients,
payload,
await ctx.checkpoint({
key: `send.notification.${payload.title}`,
fn: async () => {
await notifications.send({
recipients: notificationRecipients,
payload,
});
},
});
} catch (e) {
ctx.logger.error(`Failed to send notification: ${e}`);