diff --git a/server/lib/peertube-socket.ts b/server/lib/peertube-socket.ts
index ad2bb4845d45319feae5993ed5bec8a4a5dfbdc5..26ced351f3333cf1dfe756dc333ad95653c9ff88 100644
--- a/server/lib/peertube-socket.ts
+++ b/server/lib/peertube-socket.ts
@@ -39,8 +39,9 @@ class PeerTubeSocket {
 
     if (!sockets) return
 
+    const notificationMessage = notification.toFormattedJSON()
     for (const socket of sockets) {
-      socket.emit('new-notification', notification.toFormattedJSON())
+      socket.emit('new-notification', notificationMessage)
     }
   }