From 09c9e32d72ddd85c29097484317234e1f4c2c995 Mon Sep 17 00:00:00 2001 From: Timon Engelke Date: Fri, 12 Nov 2021 23:16:20 +0100 Subject: [PATCH] Delete session after corresponding group2session and author2session --- src/node/db/SessionManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/db/SessionManager.js b/src/node/db/SessionManager.js index b5f93094d..c614aaf87 100644 --- a/src/node/db/SessionManager.js +++ b/src/node/db/SessionManager.js @@ -204,9 +204,6 @@ exports.deleteSession = async (sessionID) => { const group2sessions = await db.get(`group2sessions:${groupID}`); const author2sessions = await db.get(`author2sessions:${authorID}`); - // remove the session - await db.remove(`session:${sessionID}`); - // remove session from group2sessions if (group2sessions != null) { // Maybe the group was already deleted delete group2sessions.sessionIDs[sessionID]; @@ -218,6 +215,9 @@ exports.deleteSession = async (sessionID) => { delete author2sessions.sessionIDs[sessionID]; await db.set(`author2sessions:${authorID}`, author2sessions); } + + // remove the session + await db.remove(`session:${sessionID}`); }; exports.listSessionsOfGroup = async (groupID) => {