Resolving Issue With Pusher Not Notifying Promptly

jenny
Member
Joined: 2025-08-24 15:11:06
2024-06-07 18:37:53

How to patch pusher not dispatching messages to users in flarum setup:

Manually patch this:
vendor\\flarum\\pusher\\js\\src\\forum\\index.tsx

app.pusher.then((binding: PusherBinding) => {

```
const channels = binding.channels;
if (channels.user) {
channels.user.bind('notification', () => {
if (app.session.user) {
app.session.user.pushAttributes({
//unreadNotificationCount: app.session.user.unreadNotificationCount() ?? 0 + 1,
unreadNotificationCount: (app.session.user.unreadNotificationCount() ?? 0) + 1,
//newNotificationCount: app.session.user.newNotificationCount() ?? 0 + 1,
newNotificationCount: (app.session.user.newNotificationCount() ?? 0) + 1,
});
}
app.notifications.clear();
m.redraw();
});
}
```

});

Image preview

Facebook X (Twitter) Instagram LinkedIn Telegram WhatsApp