Skip to content

Commit 4d3ef5d

Browse files
committed
Log payload
1 parent 8bcd562 commit 4d3ef5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backend/api/src/junk-drawer/private-messages.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,13 @@ const notifyOtherUserInChannelIfInactive = async (
173173
const subscriptions = await getSubscriptionsFromDB(otherUser.id, pg);
174174
for (const subscription of subscriptions) {
175175
try {
176-
console.log('Sending notification to:', subscription.endpoint);
177-
await webPush.sendNotification(subscription, JSON.stringify({
176+
const payload = JSON.stringify({
178177
title: `${creator.name}`,
179178
body: textContent,
180179
url: `/messages/${channelId}`,
181-
}));
180+
})
181+
console.log('Sending notification to:', subscription.endpoint, payload);
182+
await webPush.sendNotification(subscription, payload);
182183
} catch (err) {
183184
console.error('Failed to send notification', err);
184185
// optionally remove invalid subscription from DB

0 commit comments

Comments
 (0)