Merge pull request #8759 from capilkey/2.2-join-fix

Only join a user if the connection is still active
This commit is contained in:
Anton Georgiev 2020-03-11 16:59:11 -04:00 committed by GitHub
commit 5af41dabb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -30,7 +30,7 @@ export default function handleValidateAuthToken({ body }, meetingId) {
if (!User) return;
// Publish user join message
if (valid && !waitForApproval) {
if (valid && !waitForApproval && !!User.connectionId) {
Logger.info('User=', User);
userJoin(meetingId, userId, User.authToken);
}

View File

@ -27,6 +27,13 @@ export default function userLeaving(meetingId, userId, connectionId) {
return false;
}
const modifier = {
$set: {
connectionId: false,
},
};
Users.upsert(selector, modifier);
const payload = {
userId,
sessionId: meetingId,

View File

@ -45,7 +45,7 @@ export default function removeUser(meetingId, userId) {
return Logger.error(`Removing user from collection: ${err}`);
}
const sessionUserId = `${meetingId}-${userId}`;
const sessionUserId = `${meetingId}--${userId}`;
clearAllSessions(sessionUserId);
clearUserInfoForRequester(meetingId, userId);