From c7399ddc7ac3efd6797c3011959f2ac9d3f6e966 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 9 Dec 2022 13:13:06 -0800 Subject: [PATCH] Perform a complete round trip when setting a name So a newly-set name ends up on the client (and the client knows the server has it). --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index b0e7d7a..07da00a 100644 --- a/index.js +++ b/index.js @@ -85,6 +85,8 @@ io.on('connection', (socket) => { console.log("Received set-name event: " + name); socket.request.session.name = name; socket.request.session.save(); + // Complete the round trip to the client + socket.emit('inform-name', socket.request.session.name); }); // When any client comments, send that to all clients (including sender) -- 2.43.0