# notificationsSend does nothing if persistent is false

**URL:** <https://forum.heroiclabs.com/t/notificationssend-does-nothing-if-persistent-is-false/5980>\
**Category:** Runtime Framework\
**Created:** [January 29, 2025, 5:38am UTC](https://forum.heroiclabs.com/t/notificationssend-does-nothing-if-persistent-is-false/5980 "2025-01-29T05:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![od-jg](https://avatars.discourse-cdn.com/v4/letter/o/94ad74/32.png) [@od-jg](https://forum.heroiclabs.com/u/od-jg)\
**Post date:** [January 29, 2025, 5:38am UTC](https://forum.heroiclabs.com/t/notificationssend-does-nothing-if-persistent-is-false/5980/1 "2025-01-29T05:38:50Z")

</div>

When using [nk.notificationsSend()](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/function-reference/#notificationsSend) to send in-game notifications (persistent=false), no clients receive any notifications over the socket.

If instead I use [nk.notificationSend()](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/function-reference/#notificationSend) in a loop to send the exact same notifications, then it works as expected.

Seems like a bug? This is with Nakama 3.25.0 in the TypeScript runtime.

```auto
export function sendGroupEndRaidNotification(ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, groupId: string, raidId: string) {
    let groupUsers = {} as nkruntime.GroupUserList;
    try {
        groupUsers = nk.groupUsersList(groupId);
    } catch (error) {
        return;
    }
    if (!groupUsers.groupUsers || groupUsers.groupUsers.length == 0) {
        return;
    }

    let notification: nkruntime.NotificationRequest = {
        code: NotificationCode.EndRaid,
        subject: 'EndRaid',
        content: { gid: groupId, rid: raidId },
        persistent: false,
        userId: undefined
    };

    let notifications: nkruntime.NotificationRequest[] = [];
    for (let i = 0; i < groupUsers.groupUsers.length; i++) {
        let newNotification = notification;
        newNotification.userId = groupUsers.groupUsers[i].user.userId;
        notifications.push(newNotification);
        try {
            nk.notificationSend(notification.userId, 
                notification.subject, 
                notification.content, 
                notification.code, 
                notification.senderId, 
                notification.persistent); // <-- works (persistent: false)
        } catch (error) {
            logger.error("nk.notificationSend failed: error=%s", error.message);
        }
    }

    try {
        nk.notificationsSend(notifications); // <-- does not work (persistent: false)
    } catch (error) {
        logger.error("nk.notificationsSend failed: error=%s", error.message);
    }

    for (let i = 0; i < notifications.length; i++) {
        notifications[i].persistent = true;
    }
    try {
        nk.notificationsSend(notifications); // <-- works (persistent: true)
    } catch (error) {
        logger.error("nk.notificationsSend failed: error=%s", error.message);
    }
}

```

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [January 29, 2025, 11:27am UTC](https://forum.heroiclabs.com/t/notificationssend-does-nothing-if-persistent-is-false/5980/2 "2025-01-29T11:27:52Z")

</div>

Hello @od-jg,

Are there no errors in the server logs?

I’d advise you to re-throw the error after it’s caught unless you’re trying to explicitly recover from it, otherwise the error may be masked and go unnoticed.
