mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
PadMessageHandler: Don't fire userLeave
if user hasn't joined yet
This commit is contained in:
parent
87a490d456
commit
caefd2184a
1 changed files with 2 additions and 1 deletions
|
@ -131,7 +131,8 @@ exports.handleDisconnect = async (socket) => {
|
||||||
stats.meter('disconnects').mark();
|
stats.meter('disconnects').mark();
|
||||||
const session = sessioninfos[socket.id];
|
const session = sessioninfos[socket.id];
|
||||||
delete sessioninfos[socket.id];
|
delete sessioninfos[socket.id];
|
||||||
if (!session || !session.author) return;
|
// session.padId can be nullish if the user disconnects before sending CLIENT_READY.
|
||||||
|
if (!session || !session.author || !session.padId) return;
|
||||||
const {session: {user} = {}} = socket.client.request;
|
const {session: {user} = {}} = socket.client.request;
|
||||||
/* eslint-disable prefer-template -- it doesn't support breaking across multiple lines */
|
/* eslint-disable prefer-template -- it doesn't support breaking across multiple lines */
|
||||||
accessLogger.info('[LEAVE]' +
|
accessLogger.info('[LEAVE]' +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue