mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Properly await notification result
This commit is contained in:
parent
cde2836982
commit
bedc25bacf
|
|
@ -18,6 +18,10 @@ export const getPushWorker = (): Worker<PushJobData, void, PushJobType> =>
|
|||
data: { psId, relatedUserId, type, noteId, notificationId },
|
||||
} = job;
|
||||
|
||||
await job.log(
|
||||
`Sending push notification for note [${notificationId}]`,
|
||||
);
|
||||
|
||||
const ps = await PushSubscription.fromId(psId);
|
||||
|
||||
if (!ps) {
|
||||
|
|
@ -87,7 +91,7 @@ export const getPushWorker = (): Worker<PushJobData, void, PushJobType> =>
|
|||
? htmlToText(note.data.spoilerText || note.data.content)
|
||||
: htmlToText(relatedUser.data.note);
|
||||
|
||||
sendNotification(
|
||||
await sendNotification(
|
||||
{
|
||||
endpoint: ps.data.endpoint,
|
||||
keys: {
|
||||
|
|
@ -115,6 +119,10 @@ export const getPushWorker = (): Worker<PushJobData, void, PushJobType> =>
|
|||
},
|
||||
},
|
||||
);
|
||||
|
||||
await job.log(
|
||||
`✔ Finished delivering push notification for note [${notificationId}]`,
|
||||
);
|
||||
},
|
||||
{
|
||||
connection,
|
||||
|
|
|
|||
Loading…
Reference in a new issue